exception_ce = zend_ce_error;
}
+ /* Marker used to disable exception generation during preloading. */
+ if (EG(exception) == (void*)(uintptr_t)-1) {
+ return;
+ }
+
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
break;
}
if (!(ce->ce_flags & ZEND_ACC_LINKED)) {
- zend_error(E_WARNING, "Can't preload unlinked class %s at %s:%d\n", ZSTR_VAL(ce->name), ZSTR_VAL(ce->info.user.filename), ce->info.user.line_start);
+ zend_error(E_WARNING, "Can't preload unlinked class %s at %s:%d", ZSTR_VAL(ce->name), ZSTR_VAL(ce->info.user.filename), ce->info.user.line_start);
} else if (!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
- zend_error(E_WARNING, "Can't preload class %s with unresolved constants at %s:%d\n", ZSTR_VAL(ce->name), ZSTR_VAL(ce->info.user.filename), ce->info.user.line_start);
+ zend_error(E_WARNING, "Can't preload class %s with unresolved constants at %s:%d", ZSTR_VAL(ce->name), ZSTR_VAL(ce->info.user.filename), ce->info.user.line_start);
} else if (!(ce->ce_flags & ZEND_ACC_PROPERTY_TYPES_RESOLVED)) {
- zend_error(E_WARNING, "Can't preload class %s with unresolved property types at %s:%d\n", ZSTR_VAL(ce->name), ZSTR_VAL(ce->info.user.filename), ce->info.user.line_start);
+ zend_error(E_WARNING, "Can't preload class %s with unresolved property types at %s:%d", ZSTR_VAL(ce->name), ZSTR_VAL(ce->info.user.filename), ce->info.user.line_start);
} else {
continue;
}
--- /dev/null
+--TEST--
+Preloading class with undefined class constant access
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.preload={PWD}/preload_undef_const.inc
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+var_dump(class_exists('Foo'));
+?>
+--EXPECTF--
+Warning: Can't preload class Foo with unresolved constants at %s:%d in Unknown on line 0
+bool(false)