--- /dev/null
+--TEST--
+Bug #43343 (Variable class name)
+--FILE--
+<?php
+namespace Foo;
+class Bar { }
+$foo = 'bar';
+var_dump(new namespace::$foo);
+?>
+--EXPECTF--
+Fatal error: Cannot use 'namespace' as a class name in %sbug43343.php on line 5
--- /dev/null
+--TEST--
+Bug #43344.1 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+function f1($a=bar) {
+ return $a;
+}
+function f2($a=array(bar)) {
+ return $a[0];
+}
+function f3($a=array(bar=>0)) {
+ reset($a);
+ return key($a);
+}
+echo bar."\n";
+echo f1()."\n";
+echo f2()."\n";
+echo f3()."\n";
+?>
+--EXPECTF--
+Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 13
+bar
+
+Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 3
+bar
+
+Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 6
+bar
+
+Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 9
+bar
--- /dev/null
+--TEST--
+Bug #43344.10 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+echo namespace::bar."\n";
+?>
+--EXPECTF--
+Fatal error: Undefined constant 'bar' in %sbug43344_10.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.11 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+function f($a=namespace::bar) {
+ return $a;
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Undefined constant 'bar' in %sbug43344_11.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.12 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+function f($a=array(namespace::bar)) {
+ return $a[0];
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Undefined constant 'bar' in %sbug43344_12.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.13 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+function f($a=array(namespace::bar=>0)) {
+ reset($a);
+ return key($a);
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Undefined constant 'bar' in %sbug43344_13.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.2 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+echo Foo::bar."\n";
+?>
+--EXPECTF--
+Fatal error: Class 'Foo::Foo' not found in %sbug43344_2.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.3 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+function f($a=Foo::bar) {
+ return $a;
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Class 'Foo::Foo' not found in %sbug43344_3.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.4 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+function f($a=array(Foo::bar)) {
+ return $a[0];
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Class 'Foo::Foo' not found in %sbug43344_4.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.5 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+function f($a=array(Foo::bar=>0)) {
+ reset($a);
+ return key($a);
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Class 'Foo::Foo' not found in %sbug43344_5.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.6 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+echo namespace::bar."\n";
+?>
+--EXPECTF--
+Fatal error: Undefined constant 'Foo::bar' in %sbug43344_6.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.7 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+function f($a=namespace::bar) {
+ return $a;
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Undefined constant 'Foo::bar' in %sbug43344_7.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.8 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+function f($a=array(namespace::bar)) {
+ return $a[0];
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Undefined constant 'Foo::bar' in %sbug43344_8.php on line %d
--- /dev/null
+--TEST--
+Bug #43344.9 (Wrong error message for undefined namespace constant)
+--FILE--
+<?php
+namespace Foo;
+function f($a=array(namespace::bar=>0)) {
+ reset($a);
+ return key($a);
+}
+echo f()."\n";
+?>
+--EXPECTF--
+Fatal error: Undefined constant 'Foo::bar' in %sbug43344_9.php on line %d
int(2)
}
===DONE===
+--UEXPECTF--
+object(Foo)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(0)
+}
+object(Bar)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(1)
+}
+object(Baz)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(2)
+}
+object(Foo)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(0)
+}
+object(Bar)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(1)
+}
+object(Baz)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(2)
+}
+object(Foo)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(0)
+}
+object(Bar)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(1)
+}
+object(Baz)#%d (1) {
+ [u"instanceId":u"Singleton":private]=>
+ int(2)
+}
+===DONE===
057: Usage of 'namespace' in compound names (inside namespase)
--FILE--
<?php
-namespace test::ns1;
+namespace Test::ns1;
const C = "const ok\n";
zend_arg_info *cur_arg_info;
if (class_type->op_type == IS_CONST &&
+ Z_TYPE(class_type->u.constant) == ZEND_STR_TYPE &&
Z_UNILEN(class_type->u.constant) == 0) {
/* Usage of namespace as class name not in namespace */
zval_dtor(&class_type->u.constant);
zend_op *opline;
if (class_name->op_type == IS_CONST &&
+ Z_TYPE(class_name->u.constant) == ZEND_STR_TYPE &&
Z_UNILEN(class_name->u.constant) == 0) {
/* Usage of namespace as class name not in namespace */
zval_dtor(&class_name->u.constant);
ulong fetch_type = 0;
if (class_name->op_type == IS_CONST &&
+ Z_TYPE(class_name->u.constant) == ZEND_STR_TYPE &&
Z_UNILEN(class_name->u.constant) == 0) {
/* namespace::func() not in namespace */
zval_dtor(&class_name->u.constant);
+ if (CG(current_namespace)) {
+ znode tmp;
+
+ tmp.op_type = IS_CONST;
+ tmp.u.constant = *CG(current_namespace);
+ zval_copy_ctor(&tmp.u.constant);
+ zend_do_build_namespace_name(&tmp, &tmp, method_name TSRMLS_CC);
+ *method_name = tmp;
+ }
return zend_do_begin_function_call(method_name, 0 TSRMLS_CC);
}
ulong fetch_type = 0;
znode tmp;
+ if (constant_container &&
+ constant_container->op_type == IS_CONST &&
+ Z_TYPE(constant_container->u.constant) == ZEND_STR_TYPE &&
+ Z_UNILEN(constant_container->u.constant) == 0) {
+ /* namespace::const */
+ zval_dtor(&constant_container->u.constant);
+ check_namespace = 1;
+ constant_container = NULL;
+ fetch_type = ZEND_FETCH_CLASS_RT_NS_CHECK | IS_CONSTANT_RT_NS_CHECK;;
+ }
+
switch (mode) {
case ZEND_CT:
if (constant_container) {
zend_do_fetch_class_name(NULL, constant_container, constant_name TSRMLS_CC);
*result = *constant_container;
result->u.constant.type = IS_CONSTANT | fetch_type;
- } else if (!zend_constant_ct_subst(result, &constant_name->u.constant TSRMLS_CC)) {
+ } else if (fetch_type || !zend_constant_ct_subst(result, &constant_name->u.constant TSRMLS_CC)) {
if (check_namespace && CG(current_namespace)) {
/* We assume we use constant from the current namespace
if it is not prefixed. */
zval_copy_ctor(&tmp.u.constant);
zend_do_build_namespace_name(&tmp, &tmp, constant_name TSRMLS_CC);
*constant_name = tmp;
- fetch_type = IS_CONSTANT_RT_NS_CHECK;
+ fetch_type |= IS_CONSTANT_RT_NS_CHECK;
}
*result = *constant_name;
result->u.constant.type = IS_CONSTANT | fetch_type;
}
break;
case ZEND_RT:
- if (constant_container &&
- constant_container->op_type == IS_CONST &&
- Z_UNILEN(constant_container->u.constant) == 0) {
- /* Usage of namespace as class name not in namespace */
- zval_dtor(&constant_container->u.constant);
- constant_container = NULL;
- check_namespace = 0;
- }
-
if (constant_container ||
!zend_constant_ct_subst(result, &constant_name->u.constant TSRMLS_CC)) {
zend_op *opline;
tmp.u.constant = *CG(current_namespace);
zval_copy_ctor(&tmp.u.constant);
constant_container = &tmp;
- fetch_type = IS_CONSTANT_RT_NS_CHECK;
+ fetch_type |= IS_CONSTANT_RT_NS_CHECK;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FETCH_CONSTANT;
- opline->extended_value = fetch_type & ~ZEND_FETCH_CLASS_RT_NS_NAME;
+ opline->extended_value = fetch_type & ~ZEND_FETCH_CLASS_RT_NS_NAME;
opline->result.op_type = IS_TMP_VAR;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
if (constant_container) {
if (prefix) {
*result = *prefix;
+ if (Z_TYPE(result->u.constant) == ZEND_STR_TYPE &&
+ Z_UNILEN(result->u.constant) == 0) {
+ /* namespace:: */
+ if (CG(current_namespace)) {
+ znode tmp;
+
+ zval_dtor(&result->u.constant);
+ tmp.op_type = IS_CONST;
+ tmp.u.constant = *CG(current_namespace);
+ zval_copy_ctor(&tmp.u.constant);
+ zend_do_build_namespace_name(result, NULL, &tmp TSRMLS_CC);
+ }
+ }
} else {
result->op_type = IS_CONST;
Z_TYPE(result->u.constant) = ZEND_STR_TYPE;
} else {
colon.s++;
}
- zend_error(E_ERROR, "Undefined class constant '%v'", colon);
+ if ((Z_TYPE_P(p) & IS_CONSTANT_RT_NS_CHECK) == 0) {
+ zend_error(E_ERROR, "Undefined class constant '%v'", colon);
+ } else if (Z_TYPE_P(p) & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error(E_ERROR, "Undefined constant '%v'", Z_STRVAL_P(p));
+ }
+ if (UG(unicode)) {
+ Z_USTRLEN_P(p) -= ((colon.u - Z_USTRVAL_P(p)));
+ if (inline_change) {
+ colon.u = eustrndup(colon.u, Z_USTRLEN_P(p));
+ efree(Z_USTRVAL_P(p));
+ Z_USTRVAL_P(p) = colon.u;
+ } else {
+ Z_USTRVAL_P(p) = colon.u;
+ }
+ } else {
+ Z_STRLEN_P(p) -= ((colon.s - Z_STRVAL_P(p)));
+ if (inline_change) {
+ colon.s = estrndup(colon.s, Z_STRLEN_P(p));
+ efree(Z_STRVAL_P(p));
+ Z_STRVAL_P(p) = colon.s;
+ } else {
+ Z_STRVAL_P(p) = colon.s;
+ }
+ }
+ } else if (Z_TYPE_P(p) & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error(E_ERROR, "Undefined constant '%v'", Z_UNIVAL_P(p));
}
zend_error(E_NOTICE, "Use of undefined constant %v - assumed '%v'", Z_UNIVAL_P(p), Z_UNIVAL_P(p));
Z_TYPE_P(p) = UG(unicode) ? IS_UNICODE : IS_STRING;
continue;
}
if (!zend_u_get_constant_ex(ZEND_STR_TYPE, str_index, str_index_len - 3, &const_value, scope, (UG(unicode) ? str_index.u[str_index_len-2] : str_index.s[str_index_len-2]) TSRMLS_CC)) {
- if ((UG(unicode) && (colon.u = u_memchr(str_index.u, ':', str_index_len - 3)) && colon.u[1] == ':') ||
- (!UG(unicode) && (colon.s = memchr(str_index.s, ':', str_index_len - 3)) && colon.s[1] == ':')
- ) {
- zend_error(E_ERROR, "Undefined class constant '%v'", str_index);
+ if (UG(unicode)) {
+ if ((colon.u = u_memrchr(str_index.u, ':', str_index_len - 3)) && colon.u > str_index.u && *(colon.u-1) == ':') {
+ if ((str_index.u[str_index_len - 2] & IS_CONSTANT_RT_NS_CHECK) == 0) {
+ zend_error(E_ERROR, "Undefined class constant '%v'", str_index);
+ } else if (str_index.u[str_index_len - 2] & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error(E_ERROR, "Undefined constant '%v'", str_index);
+ }
+ str_index_len -= ((colon.u - str_index.u) + 1);
+ str_index.u = colon.u + 1;
+ } else if (str_index.u[str_index_len - 2] & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error(E_ERROR, "Undefined constant '%v'", str_index);
+ }
+ } else {
+ if ((colon.s = zend_memrchr(str_index.s, ':', str_index_len - 3)) && colon.s > str_index.s && *(colon.s-1) == ':') {
+ if ((str_index.s[str_index_len - 2] & IS_CONSTANT_RT_NS_CHECK) == 0) {
+ zend_error(E_ERROR, "Undefined class constant '%v'", str_index);
+ } else if (str_index.s[str_index_len - 2] & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error(E_ERROR, "Undefined constant '%v'", str_index);
+ }
+ str_index_len -= ((colon.s - str_index.s) + 1);
+ str_index.s = colon.s + 1;
+ } else if (str_index.s[str_index_len - 2] & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error(E_ERROR, "Undefined constant '%v'", str_index);
+ }
}
zend_error(E_NOTICE, "Use of undefined constant %v - assumed '%v'", str_index, str_index);
ZVAL_TEXTL(&const_value, str_index, str_index_len-3, 1);
class_name:
T_STRING { $$ = $1; }
| T_STATIC { $$.op_type = IS_CONST; ZVAL_ASCII_STRINGL(&$$.u.constant, "static", sizeof("static")-1, 1);}
- | T_NAMESPACE {if (CG(current_namespace)) { $1.op_type = IS_CONST; $1.u.constant = *CG(current_namespace); zval_copy_ctor(&$1.u.constant); zend_do_build_namespace_name(&$$, NULL, &$1 TSRMLS_CC); } else { $$.op_type = IS_CONST; ZVAL_EMPTY_TEXT(&$$.u.constant); } }
+ | T_NAMESPACE { $$.op_type = IS_CONST; ZVAL_EMPTY_TEXT(&$$.u.constant); }
| T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_build_namespace_name(&$$, NULL, &$2 TSRMLS_CC); }
| class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_build_namespace_name(&$$, &$1, &$3 TSRMLS_CC); }
;
fully_qualified_class_name:
T_STRING { $$ = $1; }
- | T_NAMESPACE {if (CG(current_namespace)) { $1.op_type = IS_CONST; $1.u.constant = *CG(current_namespace); zval_copy_ctor(&$1.u.constant); zend_do_build_namespace_name(&$$, NULL, &$1 TSRMLS_CC); } else { $$.op_type = IS_CONST; ZVAL_EMPTY_TEXT(&$$.u.constant); } }
+ | T_NAMESPACE { $$.op_type = IS_CONST; ZVAL_EMPTY_TEXT(&$$.u.constant); }
| T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_build_namespace_name(&$$, NULL, &$2 TSRMLS_CC); }
| fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_build_namespace_name(&$$, &$1, &$3 TSRMLS_CC); }
;
if (OP1_TYPE == IS_UNUSED) {
if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
+ if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error_noreturn(E_ERROR, "Undefined constant '%R'", Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
+ }
zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'",
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant),
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
ZEND_VM_NEXT_OPCODE();
} else if ((opline->extended_value & IS_CONSTANT_RT_NS_CHECK) != 0) {
- if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
+ if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error_noreturn(E_ERROR, "Undefined constant '%R::%R'", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
+ } else if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'",
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant),
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
if (IS_CONST == IS_UNUSED) {
if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
+ if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error_noreturn(E_ERROR, "Undefined constant '%R'", Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
+ }
zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'",
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant),
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
ZEND_VM_NEXT_OPCODE();
} else if ((opline->extended_value & IS_CONSTANT_RT_NS_CHECK) != 0) {
- if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
+ if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error_noreturn(E_ERROR, "Undefined constant '%R::%R'", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
+ } else if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'",
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant),
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
if (IS_VAR == IS_UNUSED) {
if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
+ if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error_noreturn(E_ERROR, "Undefined constant '%R'", Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
+ }
zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'",
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant),
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
ZEND_VM_NEXT_OPCODE();
} else if ((opline->extended_value & IS_CONSTANT_RT_NS_CHECK) != 0) {
- if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
+ if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error_noreturn(E_ERROR, "Undefined constant '%R::%R'", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
+ } else if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'",
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant),
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
if (IS_UNUSED == IS_UNUSED) {
if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
+ if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error_noreturn(E_ERROR, "Undefined constant '%R'", Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
+ }
zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'",
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant),
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
ZEND_VM_NEXT_OPCODE();
} else if ((opline->extended_value & IS_CONSTANT_RT_NS_CHECK) != 0) {
- if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
+ if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) {
+ zend_error_noreturn(E_ERROR, "Undefined constant '%R::%R'", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));
+ } else if (!zend_u_get_constant(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) {
zend_error(E_NOTICE, "Use of undefined constant %R - assumed '%R'",
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant),
Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant));