1
0
mirror of https://github.com/php/pie.git synced 2026-03-23 23:12:17 +01:00

Ensure whitespace is trimmed from PHP binary output

This commit is contained in:
James Titcumb
2026-01-06 16:14:47 +00:00
parent d41c81aeea
commit fc7359c9f0
2 changed files with 4 additions and 2 deletions

View File

@@ -422,12 +422,12 @@ PHP,
private static function cleanWarningAndDeprecationsFromOutput(string $testOutput): string
{
// Note: xdebug can prefix `PHP ` onto warnings/deprecations, so filter them out too
return implode(
return trim(implode(
"\n",
array_filter(
explode("\n", $testOutput),
static fn (string $line) => ! preg_match('/^(Deprecated|Warning|PHP Warning|PHP Deprecated):/', $line),
),
);
));
}
}

View File

@@ -2,7 +2,9 @@
# These should be implicitly filtered out by PIE
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"
echo "" # add some newlines...
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"
echo " " # add some whitespace...
echo "Deprecated: Function unsafe_function() is deprecated since 1.5, use safe_replacement() instead in example.php on line 9"
echo "Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0"
echo "PHP Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0"