Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Your comment was added to the bug successfully.
Bug #18749 is_a() behavior changed in php 5.3.7
Submitted: 2011-08-23 11:25 UTC
From: madsliejensen Assigned: alan_k
Status: Closed Package: DB_DataObject (version 1.9.5)
PHP Version: 5.3.7 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2011-08-23 11:25 UTC] madsliejensen (Mads Lie Jensen)
Description: ------------ In php 5.3.7 is_a() will now trigger the autoloader if the first argument is not an object. DB_DataObject uses a line like: if (is_a($this->$k,'DB_DataObject_Cast')) { in several places, but in most cases $this->$k is a string, and it will then trigger any __autoload() you have in your project. Which again will result in warnings thrown by php when the file is not found. These warnings are annoying, but DB_DataObject is still working as it should.

Comments

 [2011-08-23 11:48 UTC] alan_k (Alan Knowles)
It's a known bug in 5.3.7, 5.3.8 is comming out very soon, so I'm not sure it's worth fixing.
 [2011-08-23 11:52 UTC] madsliejensen (Mads Lie Jensen)
Maybe not, but some people say that is_a() in 5.3.7 is working as it should, but that changing behavior in a minor release is no good. And that 5.3.8 might fix this, but that in 5.4 is_a() will be changed to work as it currently does in 5.3.7 Perhaps, just to be a little ahead of time, it should be fixed anyway?
 [2011-08-23 12:42 UTC] alan_k (Alan Knowles)
Let's follow the bug and see what happens, I think it's a serious BC break. It's changing the documented behaviour... https://bugs.php.net/bug.php?id=55475
 [2011-08-23 20:52 UTC] rjha94 (Rajeev Jha)
Alan, I see your point and I also believe that they broke it (no matter what they say) but the concern here is that php folks may not fix it and I moved to 5.3.7 for a reason (promise of better fpm support) isn't; changing is_a to instance of a better solution? Maybe I can do that for HTML_Template_Flexy (because I use it) and send you the patches??
 [2011-08-24 06:13 UTC] doconnor (Daniel O'Connor)
5.3.8 is out today; but the bug doesn't look closed. What are the alternative options if PHP 5.3.* doesn't resolve this? Set a max PHP version in the package.xml and create a DB_DataObject2?
 [2011-08-24 07:57 UTC] alan_k (Alan Knowles)
the fix is to stick is_object($x) before all the is_a() calls I'll stick it in svn later. need to find out why it was not fixed in 5.3.8
 [2011-08-26 09:07 UTC] alan_k (Alan Knowles)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alan_k
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. got to love core....