mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Fixed bug #79022 (class_exists returns True for classes that are not ready to be used)
This commit is contained in:
parent
b829ea5f74
commit
153c9cc346
2
NEWS
2
NEWS
@ -4,6 +4,8 @@ PHP NEWS
|
||||
?? ??? ????, 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
|
||||
|
22
Zend/tests/bug79022.phpt
Normal file
22
Zend/tests/bug79022.phpt
Normal file
@ -0,0 +1,22 @@
|
||||
--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
|
@ -1487,7 +1487,7 @@ static inline void class_exists_impl(INTERNAL_FUNCTION_PARAMETERS, int flags, in
|
||||
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);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user