diff --git a/Lib/php/phpinit.swg b/Lib/php/phpinit.swg index 40f7b0766..ae72a10ae 100644 --- a/Lib/php/phpinit.swg +++ b/Lib/php/phpinit.swg @@ -9,4 +9,8 @@ SWIG_php_minit { zend_class_entry SWIGUNUSED internal_ce; SWIG_InitializeModule((void*)&module_number); +#if PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION == 0 + /* This hack is needed to avoid segfaults. */ + EG(class_table) = CG(class_table); +#endif %}