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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
9 - 2 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 06:01:30 2024 UTC