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

Bug #16770 static method being called in class, E_STRICT complains
Submitted: 2009-11-07 05:06 UTC
From: armyofda12mnkeys Assigned:
Status: Bogus Package: Date (version 1.5.0a1)
PHP Version: 5.2.5 OS: red hat linux
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 + 31 = ?

 
 [2009-11-07 05:06 UTC] armyofda12mnkeys (Arian Hojat)
Description: ------------ Looks like isValidID() and setDefault() are called statically when they are not static, php assumes it is $this luckily. Saw this problem mentioned in a thread from 2007 (http://www.pear-forum.org/topic1426.html). Not fixed yet? just simply changing those functions to static should fix problems, no? Here are the lines: Strict Standards: Non-static method Date_TimeZone::isValidID() should not be called statically, assuming $this from incompatible context in /usr/local/lib/php/Date/TimeZone.php on line 7224 Strict Standards: Non-static method Date_TimeZone::isValidID() should not be called statically, assuming $this from incompatible context in /usr/local/lib/php/Date/TimeZone.php on line 7225 Strict Standards: Non-static method Date_TimeZone::setDefault() should not be called statically, assuming $this from incompatible context in /usr/local/lib/php/Date/TimeZone.php on line 7228 Strict Standards: Non-static method Date_TimeZone::isValidID() should not be called statically, assuming $this from incompatible context in /usr/local/lib/php/Date/TimeZone.php on line 439 Test script: --------------- just require the Date.php library and php will complain

Comments

 [2009-11-09 05:04 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Bogus
Sadly a wontfix - Date is PHP4 compatable, and long past a stable release. If a Date2 gets implemented, it'll address this.
 [2009-11-09 07:02 UTC] armyofda12mnkeys (Arian Hojat)
Hey Daniel, Should I just make these methods static then so my site (which i'd prefer to keep E_STRICT) doesn't complain? is that the quickfix? Looks very simple, yes/no? its not like it was static and going non-static which would screw things up if other classes used those methods. going vice-versa, so should be fine since used within the class. (i'd prefer to make it a non-static call, but easier just to update the main function for a quickfix, right? ). Thanks!, Arian
 [2009-11-09 23:34 UTC] armyofda12mnkeys (Arian Hojat)
darn, found out there are even more static functions in other files and code uses depreciated 'is_a' (instead of instanceof). Seems like there are only 4 files and this would still be a small fix for php5. Maybe I'll just update the code to php5 then. Darn php4 compatibility :) Sorry for bothering ya Daniel, Lates