kphp
kphp copied to clipboard
Crash of the application when trying to restore the value in `hard_reset_var`
PHP code:
<?php
class A {
const a = [];
public static array $a_static = self::a + self::a;
}
var_dump(A::$a_static);
If you look at the generated code, you can find:
void f$src_index2c32a43220012f94$global_vars_reset1() noexcept {
hard_reset_var(v$A$$a_static, v$const_array$us68788cf2824807c5 + v$const_array$us68788cf2824807c5);
}
The problem arises because you are passing an expression.
At startup, you may get an error:
Warning: Critical error "Trying to call allocate for non runned script, n = 42"