diff --git a/Zend/tests/variable_with_boolean_name.phpt b/Zend/tests/variable_with_boolean_name.phpt new file mode 100644 index 00000000000..e0daad562e2 --- /dev/null +++ b/Zend/tests/variable_with_boolean_name.phpt @@ -0,0 +1,13 @@ +--TEST-- +Variable with boolean name +--FILE-- + +--EXPECT-- +int(42) +int(42) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 334d733f293..c06ebc4595e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1978,6 +1978,9 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint } zend_compile_expr(&name_node, name_ast); + if (name_node.op_type == IS_CONST) { + convert_to_string(&name_node.u.constant); + } opline = zend_emit_op(result, ZEND_FETCH_R, &name_node, NULL);