From: Ilia Alshanetsky Date: Tue, 25 Jul 2006 12:34:38 +0000 (+0000) Subject: Fixed bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the X-Git-Tag: php-5.2.0RC2~218 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd581ab476f7621b1d2602e548cef6fbbc6b48df;p=php Fixed bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the class itself). --- diff --git a/NEWS b/NEWS index b1dff832b8..82cf24a989 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Aug 2006, PHP 5.2.0RC2 +- Fixed bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the class + itself). (Ilia) 24 Jul 2006, PHP 5.2.0RC1 - Updated bundled MySQL client library to version 5.0.22 in the Windows @@ -204,7 +206,7 @@ PHP NEWS - Fixed bug #37313 (sigemptyset() used without including ). (jdolecek) - Fixed bug #37306 (max_execution_time = max_input_time). (Dmitry) -- Fixed Bug #37278 (SOAP not respecting uri in __soapCall). (Dmitry) +- Fixed bug #37278 (SOAP not respecting uri in __soapCall). (Dmitry) - Fixed bug #37256 (php-fastcgi doesn't handle connection abort). (Dmitry) - Fixed bug #37244 (Added strict flag to base64_decode() that enforces RFC3548 compliance). (Ilia) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 59b9ddf520..06c04ab596 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3536,8 +3536,7 @@ ZEND_METHOD(reflection_class, isSubclassOf) return; } - - RETURN_BOOL(instanceof_function(ce, class_ce TSRMLS_CC)); + RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce TSRMLS_CC))); } /* }}} */ diff --git a/ext/reflection/tests/bug38194.phpt b/ext/reflection/tests/bug38194.phpt new file mode 100755 index 0000000000..5c888af59d --- /dev/null +++ b/ext/reflection/tests/bug38194.phpt @@ -0,0 +1,13 @@ +--TEST-- +Reflection Bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the class itself) +--SKIPIF-- + +--FILE-- +isSubclassOf($objectClass)); +?> +--EXPECT-- +bool(false)