?? ??? ????, PHP 7.4.2
- Core:
+ . Fixed bug #79022 (class_exists returns True for classes that are not ready
+ to be used). (Laruence)
. Fixed bug #78929 (plus signs in cookie values are converted to spaces).
(Alexey Kachalin)
. Fixed bug #78973 (Destructor during CV freeing causes segfault if opline
--- /dev/null
+--TEST--
+Bug #79022 (class_exists returns True for classes that are not ready to be used)
+--FILE--
+<?php
+function my_autoloader($class) {
+ if (class_exists('Foo', 0)) {
+ new Foo();
+ }
+ if ($class == 'Foo') {
+ eval("class Foo extends Bar{}");
+ }
+
+ if ($class == 'Bar') {
+ eval("class Bar {}");
+ }
+}
+spl_autoload_register('my_autoloader');
+new Foo();
+echo "okey";
+?>
+--EXPECT--
+okey
Checks if the class exists */
ZEND_FUNCTION(class_exists)
{
- class_exists_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT);
+ class_exists_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_LINKED, ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT);
}
/* }}} */