lisachenko / z-engine

:zap: PHP Engine Direct API
MIT License
448 stars 22 forks source link

[Bug] Do not allow to throw PHP exceptions within FFI Zend callbacks #50

Open lisachenko opened 3 years ago

lisachenko commented 3 years ago

As throwing is restricted now in PHP, see https://github.com/php/php-src/pull/6366/commits/327e6c9d37dbb36c4a0097fcaabc9d58ecfe9323, I should either handle all exceptions from hooks internally with try..catch section silencing them or convert them to user fatal error with trigger_error(...,E_USER_ERROR).

Maybe there is some advanced technique to install custom exception handler for this, but I'm not aware about this.

lisachenko commented 3 years ago

Related to https://github.com/php/php-src/pull/6366