File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1325,8 +1325,7 @@ private function runTest(): mixed
1325
1325
$ this ->assertNotEmpty ($ errorLogOutput , 'Test did not call error_log(). ' );
1326
1326
} else {
1327
1327
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 );
1330
1329
}
1331
1330
}
1332
1331
}
@@ -1336,8 +1335,7 @@ private function runTest(): mixed
1336
1335
$ errorLogOutput = stream_get_contents ($ capture );
1337
1336
1338
1337
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 );
1341
1339
}
1342
1340
}
1343
1341
}
@@ -1364,6 +1362,12 @@ private function runTest(): mixed
1364
1362
return $ testResult ;
1365
1363
}
1366
1364
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
+
1367
1371
/**
1368
1372
* @throws ExpectationFailedException
1369
1373
*/
You can’t perform that action at this time.
0 commit comments