This is fine for normal code, but pthreads may copy classes without copying functions (even when PTHREADS_INHERIT_NONE is used), creating a problem - a mistake in code that would have previously caused a thrown Error will now crash the interpreter instead.
A few possible solutions:
Scan INIT_FCALL opcodes in copied op_arrays, and copy any functions found as dependent functions (similar to how we copy class hierarchies)
Use CG(compiler_options) |= ZEND_COMPILE_IGNORE_USER_FUNCTIONS - a quick and dirty fix, but this would cause minor performance degradation the first time a user function is called (probably OK for long-running applications?)
In PHP 8.2,
ZEND_INIT_FCALL
assumes that the function exists: https://github.com/php/php-src/commit/da684582d74This is fine for normal code, but pthreads may copy classes without copying functions (even when PTHREADS_INHERIT_NONE is used), creating a problem - a mistake in code that would have previously caused a thrown Error will now crash the interpreter instead.
A few possible solutions:
CG(compiler_options) |= ZEND_COMPILE_IGNORE_USER_FUNCTIONS
- a quick and dirty fix, but this would cause minor performance degradation the first time a user function is called (probably OK for long-running applications?)