pmmp / ext-pmmpthread

Fork of https://github.com/krakjoe/pthreads with a revamped API and PHP 8.1+ support
Other
81 stars 17 forks source link

ThreadedArray's std.properties may be a packed array, causing assert failures on 8.2 #94

Closed dktapps closed 1 year ago

dktapps commented 1 year ago

If ThreadedArray is populated solely by using []=, the keys will be continuous, causing PHP to allocate the properties table as a packed array.

While this is fine for most cases, PHP 8.2 starts to distinguish between packed and assoc arrays, using separate data structures for each. Notably, ReflectionClass->getProperties() results in an assertion failure on ThreadedArray objects.

dktapps commented 1 year ago

Under normal circumstances, the table would be correctly allocated as an array: https://github.com/php/php-src/blob/50a2de78a8ef5c14c5f6b5167316bd04c1bb5aba/Zend/zend_object_handlers.c#L70

However, since ThreadedArray has no properties, this code doesn't run.