php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54457 is_subclass_of inconsistent result when used with interfaces
Submitted: 2011-04-03 14:16 UTC Modified: 2011-04-05 03:18 UTC
From: giorgio dot liscio at email dot it Assigned:
Status: Duplicate Package: Class/Object related
PHP Version: 5.3.6 OS: all
Private report: No CVE-ID: None
 [2011-04-03 14:16 UTC] giorgio dot liscio at email dot it
Description:
------------
hi

interface Y{}
class A implements Y{}
class B extends A{}

echo (is_subclass_of("A", "Y") ? "TRUE" : "FALSE")."\n";  // false: incorrect
echo (is_subclass_of("B", "Y") ? "TRUE" : "FALSE")."\n";  // true: correct


is_subclass_of must includes interfaces or not,
not sometimes not and sometimes yes

thank you


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-05 03:18 UTC] felipe@php.net
-Status: Open +Status: Duplicate
 [2011-04-05 03:18 UTC] felipe@php.net
Duplicated of bug #53727
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 20:03:34 2021 UTC