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

Bug #9409 Fatal error using a non-array variable as an array
Submitted: 2006-11-21 18:34 UTC
From: gauthierm Assigned: firman
Status: Closed Package: Date (version CVS)
PHP Version: 5.1.6 OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 46 - 30 = ?

 
 [2006-11-21 18:34 UTC] gauthierm (Michael Gauthier)
Description: ------------ Every so often we get a PHP Fatal error: Cannot use object of type stdClass as array in /usr/share/pear/lib/Date/Calc.php on line 652 We are unable to reproduce this bug but looking at line 652 in our copy of Date.php shows the $months variable is used as an array in the getMonthNames() method without being initialized as an array. Normally this shouldn't be a problem but for some reason we got fatal errors. The linked patch initializes the $months variable as an array before adding elements to it. Test script: --------------- http://worksintheory.org/files/pear/Date-Calc-init-array-20061121.diff

Comments

 [2006-11-21 23:03 UTC] firman (Firman Wandayandi)
This bug has been fixed in CVS. 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.