mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Ignore optional warning output in test
Due to the greedy behaviour of regex, we can't seem to use %A? Use a for loop with a marker instead to ignore module startup warnings.
This commit is contained in:
@@ -25,11 +25,21 @@ $cmd = [
|
||||
];
|
||||
|
||||
$proc = proc_open($cmd, [['null'], ['pipe', 'w'], ['redirect', 1]], $pipes);
|
||||
echo stream_get_contents($pipes[1]);
|
||||
$output = stream_get_contents($pipes[1]);
|
||||
|
||||
// Ignore warnings if opcache loads twice or duplicate modules are loaded by searching for the preloaded marker
|
||||
$flag = false;
|
||||
foreach (explode("\n", $output) as $line) {
|
||||
if ($line === "preloaded") {
|
||||
$flag = true;
|
||||
}
|
||||
if ($flag) {
|
||||
echo $line, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%A
|
||||
preloaded
|
||||
PHP %s
|
||||
Copyright (c) The PHP Group
|
||||
|
||||
Reference in New Issue
Block a user