php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62969 Documentation does not mention is_subclass_of() change of behavior in 5.3.9
Submitted: 2012-08-29 13:31 UTC Modified: 2012-08-30 03:26 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: ar at ez dot no Assigned: googleguy (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ar at ez dot no
New email:
PHP Version: OS:

 

 [2012-08-29 13:31 UTC] ar at ez dot no
Description:
------------
---
From manual page: http://www.php.net/function.is-subclass-of#refsect1-function.is-
subclass-of-changelog
---


The documentation should somehow make the reader aware that is_subclass_of did not 
work reliable with interfaces before 5.3.9 when https://bugs.php.net/bug.php?
id=53727 and https://bugs.php.net/bug.php?id=55475 where fixed.

It should maybe point the reader to class_implements() for a way to realiable 
check that a class name (string) implements  a given interface.

Test script:
---------------
<?php

interface MyInterface {}
class MyClass implements MyInterface {}

// This will fail on 5.3.8 and earlier, this has been fixed
// in #53727, but doc does not reflect that.

echo (is_subclass_of('MyClass', 'MyInterface') ? 'true' : 'false');

Expected result:
----------------
true

Actual result:
--------------
false

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-29 13:33 UTC] ar at ez dot no
( Updated Summary )
 [2012-08-29 13:33 UTC] ar at ez dot no
-Summary: Documentation does not mention change of behavior in 5.3.9 caused by is_a chang +Summary: Documentation does not mention is_subclass_of() change of behavior in 5.3.9
 [2012-08-30 03:17 UTC] googleguy@php.net
Automatic comment from SVN on behalf of googleguy
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=327374
Log: Added change log entry for is_subclass_of() behavior change using interfaces and new example to demonstrate. Fixes Bug #62969.
 [2012-08-30 03:26 UTC] googleguy@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2012-08-30 03:26 UTC] googleguy@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: googleguy
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 15:00:01 2026 UTC