]> granicus.if.org Git - php/commitdiff
Fixed run-tests.php for PHP 7.2
authorFlávio Heleno <flaviohbatista@gmail.com>
Fri, 24 Apr 2020 01:26:35 +0000 (22:26 -0300)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 27 Apr 2020 09:55:40 +0000 (11:55 +0200)
Flexible heredoc syntax is only available since PHP 7.3.

Closes GH-5444.

run-tests.php

index b708f73c72b8ae4e71518a5d7e44907c2d84b63e..ffdb72a00ee32384b4dbcb42440cbbeab269b554 100755 (executable)
@@ -2748,7 +2748,7 @@ COMMAND $cmd
         }
 
         // write .sh
-        if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, <<<SH
+        $sh_script = <<<SH
 #!/bin/sh
 
 case "$1" in
@@ -2765,7 +2765,8 @@ case "$1" in
     {$cmd}
     ;;
 esac
-SH, FILE_BINARY) === false) {
+SH;
+        if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, $sh_script, FILE_BINARY) === false) {
             error("Cannot create test shell script - $sh_filename");
         }
         chmod($sh_filename, 0755);