From 2269b1801d3e55d6895ff4c066e9f485c1f5ac2f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 4 Jan 2015 18:07:44 +0100 Subject: [PATCH] Add missing string cast for non-cv var fetches --- Zend/tests/variable_with_boolean_name.phpt | 13 +++++++++++++ Zend/zend_compile.c | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 Zend/tests/variable_with_boolean_name.phpt 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);