Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Platform/TargetPhp/PhpBinaryPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,12 @@ private static function guessWithPhpConfig(self $phpBinaryPath): self
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),
),
);
));
}
}
2 changes: 2 additions & 0 deletions test/assets/valid-php-with-warnings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down