File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1325,8 +1325,7 @@ private function runTest(): mixed
13251325 $ this ->assertNotEmpty ($ errorLogOutput , 'Test did not call error_log(). ' );
13261326 } else {
13271327 if ($ errorLogOutput !== false ) {
1328- // strip date from logged error, see https://github.com/php/php-src/blob/c696087e323263e941774ebbf902ac249774ec9f/main/main.c#L905
1329- print preg_replace ('/\[.+\] / ' , '' , $ errorLogOutput );
1328+ print $ this ->stripDateFromErrorLog ($ errorLogOutput );
13301329 }
13311330 }
13321331 }
@@ -1336,8 +1335,7 @@ private function runTest(): mixed
13361335 $ errorLogOutput = stream_get_contents ($ capture );
13371336
13381337 if ($ errorLogOutput !== false ) {
1339- // strip date from logged error, see https://github.com/php/php-src/blob/c696087e323263e941774ebbf902ac249774ec9f/main/main.c#L905
1340- print preg_replace ('/\[.+\] / ' , '' , $ errorLogOutput );
1338+ print $ this ->stripDateFromErrorLog ($ errorLogOutput );
13411339 }
13421340 }
13431341 }
@@ -1364,6 +1362,12 @@ private function runTest(): mixed
13641362 return $ testResult ;
13651363 }
13661364
1365+ private function stripDateFromErrorLog (string $ log ): string
1366+ {
1367+ // https://github.com/php/php-src/blob/c696087e323263e941774ebbf902ac249774ec9f/main/main.c#L905
1368+ return preg_replace ('/\[\d+-\w+-\d+ \d+:\d+:\d+ [^\r\n[\]]+?\] / ' , '' , $ log );
1369+ }
1370+
13671371 /**
13681372 * @throws ExpectationFailedException
13691373 */
You can’t perform that action at this time.
0 commit comments