Re: Long-Term Planning for PHP 9.0 Error Promotion
Am 30.01.2022 um 16:55 schrieb Nikita Popov <[email protected]>:
> Something I want to add here is that there is also an important technical
> motivation behind promoting undefined variable notices to exceptions: The
> big problem with these (from a pure implementation perspective) is that we
> need to throw the warning and continue running. But the warning might call
> a custom error handler, which may modify state that the virtual machine
> does not expect to be modified. The PHP VM plays increasingly complex games
> to prevent this, but despite all that complexity, this problem cannot be
> fully solved while this remains a warning, rather than an exception.
Just so it has been mentioned: This could also be addressed by removing the warning (-:C
Out of curiosity: If undefined variables would be turned into exceptions, is the fact that now
almost every operation can throw an exception that much easier to handle?
- Chris
Thread (32 messages)