iliaa           Tue Jul 25 12:36:29 2006 UTC

  Modified files:              
    /php-src/ext/reflection/tests       bug38194.phpt 
    /php-src/ext/reflection     php_reflection.c 
  Log:
  MFB: Fixed bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the 
  class itself). 
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/bug38194.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/reflection/tests/bug38194.phpt
diff -u /dev/null php-src/ext/reflection/tests/bug38194.phpt:1.2
--- /dev/null   Tue Jul 25 12:36:29 2006
+++ php-src/ext/reflection/tests/bug38194.phpt  Tue Jul 25 12:36:29 2006
@@ -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)
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.245&r2=1.246&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.245 
php-src/ext/reflection/php_reflection.c:1.246
--- php-src/ext/reflection/php_reflection.c:1.245       Mon Jul 24 17:55:41 2006
+++ php-src/ext/reflection/php_reflection.c     Tue Jul 25 12:36:29 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_reflection.c,v 1.245 2006/07/24 17:55:41 helly Exp $ */
+/* $Id: php_reflection.c,v 1.246 2006/07/25 12:36:29 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -3574,8 +3574,7 @@
                        return;
        }
 
-
-       RETURN_BOOL(instanceof_function(ce, class_ce TSRMLS_CC));
+       RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce 
TSRMLS_CC)));
 }
 /* }}} */
 
@@ -4838,7 +4837,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Reflection", "enabled");
 
-       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.245 
2006/07/24 17:55:41 helly Exp $");
+       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.246 
2006/07/25 12:36:29 iliaa Exp $");
 
        php_info_print_table_end();
 } /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to