From: Nikita Popov Date: Sun, 4 Jan 2015 17:07:44 +0000 (+0100) Subject: Add missing string cast for non-cv var fetches X-Git-Tag: PRE_PHP7_REMOVALS~33^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2269b1801d3e55d6895ff4c066e9f485c1f5ac2f;p=php Add missing string cast for non-cv var fetches --- diff --git a/Zend/tests/variable_with_boolean_name.phpt b/Zend/tests/variable_with_boolean_name.phpt new file mode 100644 index 0000000000..e0daad562e --- /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 334d733f29..c06ebc4595 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);