Edit report at https://bugs.php.net/bug.php?id=55189&edit=1

 ID:                 55189
 User updated by:    jo at feuersee dot de
 Reported by:        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)
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        5.3SVN-2011-07-12 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

Changed subject to reflect that the 1st param is the important one.


Previous Comments:
------------------------------------------------------------------------
[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

Reply via email to