Fixed #75396 - Exit inside generator finally results in fatal error#2870
Fixed #75396 - Exit inside generator finally results in fatal error#2870andrewnester wants to merge 1 commit intophp:masterfrom
Conversation
|
@nikic I agree on this. Actually, why do we even run destructors at all upon unclean shutdown? |
|
@bwoebi We sort-of don't. Destructors are run on unclean shutdown, but for fatal errors specifically we explicitly mark all objects as destructed prior to bailout. So basically "exit" is the only (common) unclean shutdown scenario where we actually do run destructors. |
|
Then I agree for fatal errors (I honestly don't care too much about that specific case), but generators not be special cased relative to all other destructors. The destructor of the generator is to run finally, and so shall it run when all other destructors are called. |
|
@bwoebi The generator dtor is only there to run finally though, and we do not run finally blocks on unclean shutdown (independent on whether it's using exit or fatal error). So I'd say it's consistent to not run them here either. Btw I think we should run finally blocks on exit in general, but that's a more general issue. |
|
I guess we are unhappy with the approach here ... any plans to implement any other solution ? |
|
I am closing this pul request at the moment as new solution need to be introduced (will try to make it in separate CR) |
Fix for https://bugs.php.net/bug.php?id=75396