Skip to content

Commit 0fd52a2

Browse files
authored
Merge pull request #477 from php/1.3.x
Merge up 1.3.x to 1.4.x for PHP Binary whitespace fix
2 parents d53ad0e + 90d6d18 commit 0fd52a2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Platform/TargetPhp/PhpBinaryPath.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,12 @@ private static function guessWithPhpConfig(self $phpBinaryPath): self
446446
private static function cleanWarningAndDeprecationsFromOutput(string $testOutput): string
447447
{
448448
// Note: xdebug can prefix `PHP ` onto warnings/deprecations, so filter them out too
449-
return implode(
449+
return trim(implode(
450450
"\n",
451451
array_filter(
452452
explode("\n", $testOutput),
453453
static fn (string $line) => ! preg_match('/^(Deprecated|Warning|PHP Warning|PHP Deprecated):/', $line),
454454
),
455-
);
455+
));
456456
}
457457
}

test/assets/valid-php-with-warnings.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
# These should be implicitly filtered out by PIE
44
echo "PHP Warning: PHP Startup: Unable to load dynamic library 'redis' (tried: /path/to/redis (dlopen(/path/to/redis, 0x0009): [...] in Unknown on line 0"
5+
echo "" # add some newlines...
56
echo "Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /path/to/pdo_mysql (/path/to/pdo_mysql: cannot open shared object file: No such file or directory), /path/to/pdo_mysql.so (/path/to/pdo_mysql.so: undefined symbol: mysqlnd_debug_std_no_trace_funcs)) in Unknown on line 0"
7+
echo " " # add some whitespace...
68
echo "Deprecated: Function unsafe_function() is deprecated since 1.5, use safe_replacement() instead in example.php on line 9"
79
echo "Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0"
810
echo "PHP Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0"

0 commit comments

Comments
 (0)