diff options
| author | Dmitry Stogov <dmitry@php.net> | 2007-11-01 11:58:58 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2007-11-01 11:58:58 +0000 |
| commit | acd9a96010b76e1269f6893074d093edd2c55bf2 (patch) | |
| tree | cb761e07fc1e62aa32b84fcc9b705e75382c47c3 | |
| parent | a1d37c3c7f71cad6b7896e6ff41a6abd67604940 (diff) | |
| download | php-git-acd9a96010b76e1269f6893074d093edd2c55bf2.tar.gz | |
Fixed bug #43027 (Declare cause fatal error)
| -rwxr-xr-x | Zend/tests/bug43027.phpt | 10 | ||||
| -rw-r--r-- | Zend/zend_compile.c | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/Zend/tests/bug43027.phpt b/Zend/tests/bug43027.phpt new file mode 100755 index 0000000000..2cf2d1d6a5 --- /dev/null +++ b/Zend/tests/bug43027.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #43027 (Declare cause fatal error) +--FILE-- +<?php +declare(ticks=1); +namespace test; +echo "ok\n"; +?> +--EXPECT-- +ok diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 291fce27b4..2b97eb0de0 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4568,10 +4568,11 @@ void zend_do_namespace(znode *name TSRMLS_DC) /* {{{ */ char *lcname; if (CG(active_op_array)->last > 0) { - /* ignore ZEND_EXT_STMT */ + /* ignore ZEND_EXT_STMT and ZEND_TICKS */ int num = CG(active_op_array)->last; while (num > 0 && - CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT) { + (CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT || + CG(active_op_array)->opcodes[num-1].opcode == ZEND_TICKS)) { --num; } if (num > 0) { |
