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

Bug #18254 Strict Standards errors
Submitted: 2011-02-08 20:31 UTC
From: rudy_bruneau Assigned: doconnor
Status: Closed Package: Mail2
PHP Version: 5.2.11 OS: Windows XP SP 3
Roadmaps: (Not assigned)    
Subscription  


 [2011-02-08 20:31 UTC] rudy_bruneau (Rudy Bruneau)
Description: ------------ With Php 5.2.11 i've a problem with is_a() method and when execute PEAR Mail script to send an email many Strict Standards errors displayed. - Strict Standards : Non-static method PEAR::isError() should not be called statically. - Strict Standards : Non-static method Mail::factory() should not be called statically. Actual result: -------------- Strict Standards: Non-static method Mail::factory() should not be called statically, assuming $this from incompatible context in [...] Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 252 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in [...]

Comments

 [2011-08-18 11:20 UTC] danack (Dan Ackroyd)
I believe only the warning message "Non-static method Mail::factory() should not be called statically." This should be fixed by changing line 74 of Mail.php from function &factory($driver, $params = array()) to static function &factory($driver, $params = array())
 [2011-12-27 16:13 UTC] djeyewater (Dave Kennard)
If you look at the Mail class there are a few instances of it calling methods statically when the methods are not declared as static. I think the problem probably boils down to the class being written for PHP4, or at least being written to be PHP4 compatible. It would be nice to have a PHP5 fork of the code. I also have many other error messages caused by the Mail class, such as Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in Net/SMTP.php on line 421
 [2013-08-08 23:43 UTC] sstringer (Steve Stringer)
I can confirm this is still happening in PHP 5.4.10 as of Aug 2013. When attempting to send an email using PEAR MAIL, I get the following errors: Strict Standards: Non-static method Mail::factory() should not be called statically, assuming $this from incompatible context in /Users/ixnayus/Sites/MySites/Games2U/G2UWare/html/lib/email/class_email_handler.php on line 485 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Mail/smtp.php on line 365 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 450 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 467 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 474 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 517 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 265 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 521 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Mail/smtp.php on line 249 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Mail/smtp.php on line 285 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 952 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 265 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 955 Strict Standards: Non-static method Mail_RFC822::parseAddressList() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Mail.php on line 253 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 982 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 265 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 985 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 982 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 265 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 985 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 1063 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 265 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 1066 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 1126 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 265 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 1136 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 265 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 1141 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 491 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 265 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 494 Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/bin/php/php5.4.10/lib/php/Net/SMTP.php on line 497
 [2013-08-30 06:41 UTC] hoffmant99 (trevor hoffman)
I've encountered this problem before: Maybe change the flags in the php.ini file to disregard STRICT ex: ... insided php.ini file ; Default Value: E_ALL & ~E_NOTICE ; Development Value: E_ALL | E_STRICT ; Production Value: E_ALL & ~E_DEPRECATED ; http://php.net/error-reporting error_reporting = E_ALL | E_STRICT
 [2014-02-27 02:31 UTC] arian (Arian Fa)
So i've also changed this file Find php/pear/PEAR.php, go to line 250 and change: function isError($data, $code = null) to static function isError($data, $code = null) BUTTT when I change the following file Mail\RFC822.php, line 173 function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null) to static function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null) php can't load the page anymore....
 [2014-06-04 10:56 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Assigned -Package: Mail +Package: Mail2 -Assigned To: +Assigned To: doconnor
I've forked Mail to create Mail2. A few of the dependencies will still need to be forked to raise exceptions and what have you.
 [2014-06-04 13:03 UTC] doconnor (Daniel O'Connor)
-Status: Assigned +Status: Closed
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.