php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38194 ReflectionClass::isSubclassOf() returns TRUE for the class itself
Submitted: 2006-07-24 15:01 UTC Modified: 2006-07-25 12:36 UTC
From: alex at kiesel dot name Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 5.1.4 OS: FreeBSD 6.0
Private report: No CVE-ID:
 [2006-07-24 15:01 UTC] alex at kiesel dot name
Description:
------------
The ReflectionClass::isSubclassOf() returns TRUE when passing a ReflectionClass object of the same class as parameter. A class is not a subclass of itself, however.

Reproduce code:
---------------
<?php

  class Object { }
  
  $objectClass= new ReflectionClass('Object');
  var_dump($objectClass->isSubclassOf($objectClass));

?>


Expected result:
----------------
bool(false)

Actual result:
--------------
bool(true)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-25 12:36 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 06:02:27 2014 UTC