]> granicus.if.org Git - php/commitdiff
Fixed bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the
authorIlia Alshanetsky <iliaa@php.net>
Tue, 25 Jul 2006 12:34:38 +0000 (12:34 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 25 Jul 2006 12:34:38 +0000 (12:34 +0000)
class itself).

NEWS
ext/reflection/php_reflection.c
ext/reflection/tests/bug38194.phpt [new file with mode: 0755]

diff --git a/NEWS b/NEWS
index b1dff832b815f8c7409ae33450582c9fc2edb3eb..82cf24a98911909b03c4d9b9ca72cf1c2a4ecb6d 100644 (file)
--- 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 <signal.h>).
   (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)
index 59b9ddf5205192750dee55e1cac8fa275834acb5..06c04ab59606f5a71e19e9d59669d35ab6cd697c 100644 (file)
@@ -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 (executable)
index 0000000..5c888af
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+Reflection Bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the class itself)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+class Object { }
+  
+$objectClass= new ReflectionClass('Object');
+var_dump($objectClass->isSubclassOf($objectClass));
+?>
+--EXPECT--
+bool(false)