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: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alex at kiesel dot name
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Mon Feb 03 14:01:30 2025 UTC