Add missing string cast for non-cv var fetches

This commit is contained in:
Nikita Popov 2015-01-04 18:07:44 +01:00
parent 69a4b135f3
commit 2269b1801d
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,13 @@
--TEST--
Variable with boolean name
--FILE--
<?php
${true} = 42;
var_dump(${true});
var_dump(${'1'});
?>
--EXPECT--
int(42)
int(42)

View File

@ -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);