Bug #55189 [Opn->Csd]: BC break in behavior of is_a() (1st param '' no longer accepted)
Edit report at https://bugs.php.net/bug.php?id=55189&edit=1
ID: 55189
Updated by: sixd@php.net
Reported by: jo at feuersee dot de
Summary: BC break in behavior of is_a() (1st param '' no
longer accepted)
-Status: Open
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Linux
PHP Version: 5.3SVN-2011-07-12 (SVN)
-Assigned To:
+Assigned To: sixd
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2011-07-12 12:03:21] jo at feuersee dot de
Changed subject to reflect that the 1st param is the important one.
------------------------------------------------------------------------
[2011-07-12 11:54:20] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55189&edit=1
Thread (3 messages)