Commit 2ce2d1a
committed
Runner: add test for "out of memory" shutdown handler
PR squizlabs/PHP_CodeSniffer 3630 introduced a shutdown handler specifically to provide a more user-friendly error message when users run into "out of memory" errors.
One of the challenges of doing this is making sure that enough memory is allocated for our own error message beforehand to make sure that the error message can still be created and displayed properly, even though PHP has already run out of memory.
As of PHP 8.5, a new `fatal_error_backtraces` ini setting has been added and enabled by default, which adds a backtrace to fatal errors, which could have an impact on this memory allocation.
> If the sub-vote to default to “1” passes, messages for fatal errors will now contain backtraces and may not match the format existing code is expecting.
As this _may_ (or may not) impact the shutdown function in PHPCS, I'm adding some end-to-end tests to safeguard this functionality.
Also reserving a little extra memory for the base message to be safer anyway.
Ref: https://wiki.php.net/rfc/error_backtraces_v2#backward_incompatible_changes1 parent 9efde63 commit 2ce2d1a
2 files changed
+29
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
957 | 957 | | |
958 | 958 | | |
959 | 959 | | |
960 | | - | |
| 960 | + | |
961 | 961 | | |
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
965 | | - | |
| 965 | + | |
966 | 966 | | |
967 | 967 | | |
968 | 968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments