From 153c9cc346bae927394d3ce1378f77fb7c1e1be3 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 24 Dec 2019 14:04:19 +0800 Subject: Fixed bug #79022 (class_exists returns True for classes that are not ready to be used) --- NEWS | 2 ++ Zend/tests/bug79022.phpt | 22 ++++++++++++++++++++++ Zend/zend_builtin_functions.c | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug79022.phpt diff --git a/NEWS b/NEWS index a3788adaca..881d0c8697 100644 --- a/NEWS +++ b/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 diff --git a/Zend/tests/bug79022.phpt b/Zend/tests/bug79022.phpt new file mode 100644 index 0000000000..252effdb31 --- /dev/null +++ b/Zend/tests/bug79022.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #79022 (class_exists returns True for classes that are not ready to be used) +--FILE-- + +--EXPECT-- +okey diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index d3bf032c10..f4733d7b1f 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -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); } /* }}} */ -- cgit v1.2.1