mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
Add missing string cast for non-cv var fetches
This commit is contained in:
parent
69a4b135f3
commit
2269b1801d
13
Zend/tests/variable_with_boolean_name.phpt
Normal file
13
Zend/tests/variable_with_boolean_name.phpt
Normal 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)
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user