[5.8] Allocate memory for error handling to allow handling memory exhaustion limits#29226
Conversation
|
Provide before and after screenshots of the difference in error messages please. |
|
This solution won't work, however, in the case that this method is called more than once? |
|
Is setting to null actually guaranteed to release the memory. How does PHP calculate this? Do we have to wait for the garbage collector? |
|
Also - whats the performance hit (if any) on running the 'x' repeat command |
|
@taylorotwell @GrahamCampbell From what I've been able to see, setting a variable to null frees the memory immediately. @laurencei Thanks for the feedback and comments! |
|
I like this approach, very useful. Though I would find it really nice if there was a bit of documentation on the proper on what it is for. @skylerfenn do you think you could add that? |
|
Memory is very expensive. Is that really reasonable? |


Allots 10kb of memory for "memory exhaustion" errors.
It lets the application give a more descriptive error than the default Fatal Error that is thrown for memory exhaustion.
The concept was taken from Symfony's error handler: https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/ErrorHandler/ErrorHandler.php.