?? ??? 2015, PHP 5.6.16
- Core:
+ . Fixed bug #70828 (php-fpm 5.6 with opcache crashes when referencing a
+ non-existent constant). (Laruence)
. Fixed bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l).
(Laruence)
--- /dev/null
+--TEST--
+Bug #70828 (php-fpm 5.6 with opcache crashes when referencing a non-existent constant)
+--FILE--
+<?php
+
+namespace test {
+ use const nonexistent;
+
+ class test {
+ static function run(){
+ var_dump(nonexistent);
+ existent;
+ }
+ }
+}
+
+namespace {
+ define("test\\existent", "bug!", 1);
+ test\test::run();
+}
+?>
+--EXPECTF--
+Notice: Use of undefined constant nonexistent - assumed 'nonexistent' in /home/huixinchen/opensource/php-5.6/Zend/tests/bug70828.php on line 8
+string(11) "nonexistent"
opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 0 TSRMLS_CC);
} else {
opline->extended_value = IS_CONSTANT_UNQUALIFIED;
- if (CG(current_namespace)) {
+ if (check_namespace && CG(current_namespace)) {
opline->extended_value |= IS_CONSTANT_IN_NAMESPACE;
opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 1 TSRMLS_CC);
} else {