diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2014-04-11 18:21:46 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2014-04-11 18:21:46 +0200 |
commit | ee2a7c7d41ec98c7529b46583f49e0936cac8774 (patch) | |
tree | 9f7cc94cac8354597b4143f234635ee59e6bc58c /Zend/zend_ast.c | |
parent | ad05d3898eae472532620ce9623c9d39c23ef16a (diff) | |
download | php-git-ee2a7c7d41ec98c7529b46583f49e0936cac8774.tar.gz |
Fixed disallowal of array usage in constants at run-time
Added at the same time the possibility of array dereferencing
to complete the set of features (useful application of arrays in constants)
Diffstat (limited to 'Zend/zend_ast.c')
-rw-r--r-- | Zend/zend_ast.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 8a3df98c10..fa32232516 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -322,6 +322,18 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s } } break; + case ZEND_FETCH_DIM_R: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + { + zval *tmp; + zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC); + *result = *tmp; + efree(tmp); + } + zval_dtor(&op1); + zval_dtor(&op2); + break; default: zend_error(E_ERROR, "Unsupported constant expression"); } |