@@ -160,10 +160,6 @@ function main()
160
160
$ environment ["SystemRoot " ] = getenv ("SystemRoot " );
161
161
}
162
162
163
- // Don't ever guess at the PHP executable location.
164
- // Require the explicit specification.
165
- // Otherwise we could end up testing the wrong file!
166
-
167
163
$ php = null ;
168
164
$ php_cgi = null ;
169
165
$ phpdbg = null ;
@@ -461,11 +457,7 @@ function main()
461
457
$ environment ['TEST_PHP_EXECUTABLE ' ] = $ php ;
462
458
break ;
463
459
case 'P ' :
464
- if (constant ('PHP_BINARY ' )) {
465
- $ php = PHP_BINARY ;
466
- } else {
467
- break ;
468
- }
460
+ $ php = PHP_BINARY ;
469
461
putenv ("TEST_PHP_EXECUTABLE= $ php " );
470
462
$ environment ['TEST_PHP_EXECUTABLE ' ] = $ php ;
471
463
break ;
@@ -567,7 +559,7 @@ function main()
567
559
568
560
-p <php> Specify PHP executable to run.
569
561
570
- -P Use PHP_BINARY as PHP executable to run.
562
+ -P Use PHP_BINARY as PHP executable to run (default) .
571
563
572
564
-q Quiet, no user interaction (same as environment NO_INTERACTION).
573
565
@@ -652,6 +644,13 @@ function main()
652
644
}
653
645
}
654
646
647
+ // Default to PHP_BINARY as executable
648
+ if (!isset ($ environment ['TEST_PHP_EXECUTABLE ' ])) {
649
+ $ php = PHP_BINARY ;
650
+ putenv ("TEST_PHP_EXECUTABLE= $ php " );
651
+ $ environment ['TEST_PHP_EXECUTABLE ' ] = $ php ;
652
+ }
653
+
655
654
if (strlen ($ conf_passed )) {
656
655
if (substr (PHP_OS , 0 , 3 ) == "WIN " ) {
657
656
$ pass_options .= " -c " . escapeshellarg ($ conf_passed );
0 commit comments