--- /dev/null
+--TEST--
+Bug #69832 (Assertion failed in zend_compile_const_expr_magic_const)
+--FILE--
+<?php
+
+class Test {
+ public $foo = [Bar::A, __CLASS__];
+}
+
+eval(<<<'PHP'
+class Bar {
+ const A = 1;
+}
+PHP
+);
+
+var_dump((new Test)->foo);
+
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ string(4) "Test"
+}
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
+ zend_bool is_constant = 1;
/* First ensure that *all* child nodes are constant and by-val */
for (i = 0; i < list->children; ++i) {
if (by_ref || elem_ast->child[0]->kind != ZEND_AST_ZVAL
|| (elem_ast->child[1] && elem_ast->child[1]->kind != ZEND_AST_ZVAL)
) {
- return 0;
+ is_constant = 0;
}
}
+ if (!is_constant) {
+ return 0;
+ }
+
array_init_size(result, list->children);
for (i = 0; i < list->children; ++i) {
zend_ast *elem_ast = list->child[i];