php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55189 BC break in behavior of is_a() (1st param '' no longer accepted)
Submitted: 2011-07-12 11:54 UTC Modified: 2011-07-12 14:52 UTC
From: jo at feuersee dot de Assigned: stas (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3SVN-2011-07-12 (SVN) OS: Linux
Private report: No CVE-ID: None
 [2011-07-12 11:54 UTC] jo at feuersee dot de
Description:
------------
I notice a different bahavior between PHP5.3.6 and a daily build supplied by the openSUSE build service, designated php5-5.3.6.201107111820-83.1 with php - output is "PHP 5.3.7RC3-dev (cli)"

In short, is_a('', '') emits a warning with php/5.3.7rc3 which did not happen with 5.3.6 and AFAIK earlier versions.

I know that is_a('', '') doesn't make much sense, but it's a BC break. To be more precise, I stumbled across this when upgrading a PEAR repo and to my surprise got a bunch of warnings (Warning: Unknown class passed as parameter in /usr/share/php5/PEAR/PEAR.php on line 252) and tracked it down to the is_a() call.

I'm not really sure if this was planned and/or is a documentation issue, but just to be sure it is an intentional change I put this here to be discussed.

AFAIK from reading the php.internals mailing list, such a change in behavior in a minor update is most likely not intentional ;)

Test script:
---------------
In a shell type the following:
php -r 'printf("%d\n", is_a("", ""));'

(Note: in case of Windows OS the ' and " have to be replaced with each other)

Expected result:
----------------
0


Actual result:
--------------
Warning: Unknown class passed as parameter in Command line code on line 1

0


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-12 12:03 UTC] jo at feuersee dot de
-Summary: BC break in behavior of is_a() +Summary: BC break in behavior of is_a() (1st param '' no longer accepted)
 [2011-07-12 12:03 UTC] jo at feuersee dot de
Changed subject to reflect that the 1st param is the important one.
 [2011-07-12 14:51 UTC] sixd@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: sixd
 [2011-07-12 14:51 UTC] sixd@php.net
This bug has been fixed in SVN.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

This issue was discussed is various forums ever since it was introduced.
The warning message was reverted yesterday in:
http://svn.php.net/viewvc?view=revision&revision=313162
 [2011-07-12 14:52 UTC] sixd@php.net
-Assigned To: sixd +Assigned To: stas
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 16:01:36 2024 UTC