As discussed in discord, having default property $test set to STARTING causes a segfault, with no default it works.
Reproducing Code
<?php
enum ThreadStatus: int{
case STARTING = 0;
}
class thread extends \pmmp\thread\Thread{
private ThreadStatus $test = ThreadStatus::STARTING;
public function run(): void{}
}
(new thread())->start(\pmmp\thread\Thread::INHERIT_NONE);
Expected Output
N/A
Actual Output
Assertion failed: (prepared->backed_enum_table), function prepare_class_constants, file prepare.c, line 74.
Process 2432 stopped
* thread #6, stop reason = hit program assert
frame #4: 0x00000001004609d0 php`prepare_class_constants(source=0x0000600003d08760, candidate=0x0000000107565370, prepared=0x0000000107603018) at prepare.c:74:5
71 zend_zval_type_name(enum_value)
72 );
73 }
-> 74 ZEND_ASSERT(prepared->backed_enum_table);
75 //zend_enum_add_case() won't expect this to be populated, so we have to remove it (we populated it in prepare_backed_enum_table())
76 if (Z_TYPE(copied_enum_value) == IS_STRING) {
77 zend_hash_del(prepared->backed_enum_table, Z_STR(copied_enum_value));
Target 0: (php) stopped.
Environment
PHP 8.2.8 (cli) (built: Aug 10 2023 17:56:54) (ZTS DEBUG)
&PHP 8.3.0beta2 (cli) (built: Aug 13 2023 18:48:54) (ZTS DEBUG)
Summary
As discussed in discord, having default property
$test
set toSTARTING
causes a segfault, with no default it works.Reproducing Code
Expected Output
N/A
Actual Output