You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extensions imported using dl in the main thread incorrectly copy functions to the one created using the extension, although the extension is connected. The problem is solved only if you manually register module_entry->functions in pthreads_prepared_startup, according to the code from zend_register_module_ex
Reproducing Code
dl('mbstring');
//////////
use pmmp\thread\Thread as Thread;
$thread = new class extends Thread
{
public function run() : void
{
print_r(mb_strtolower('text'));
}
};
$thread->start(Thread::INHERIT_ALL) && $thread->join();
Expected Output
text
Actual Output
Call to undefined function mb_strtolower
The text was updated successfully, but these errors were encountered:
Currently the extension assumes that all functions will be automatically present on other threads. dl() was never considered. To be honest, I'm not actually 100% sure it makes sense for dl() to affect other threads anyway.
Environment
Summary
Extensions imported using dl in the main thread incorrectly copy functions to the one created using the extension, although the extension is connected. The problem is solved only if you manually register module_entry->functions in pthreads_prepared_startup, according to the code from zend_register_module_ex
Reproducing Code
dl('mbstring');
//////////
Expected Output
text
Actual Output
Call to undefined function mb_strtolower
The text was updated successfully, but these errors were encountered: