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

Bug #17866 Non-static method Mail_RFC822::parseAddressList called statically
Submitted: 2010-09-14 17:40 UTC
From: myguitar82 Assigned: alec
Status: Closed Package: Mail (version 1.2.0)
PHP Version: 5.3.2 OS: Linux
Roadmaps: (Not assigned)    

 [2010-09-14 17:40 UTC] myguitar82 (Brandon Liles)
Description: ------------ When running with E_STRICT: The non-static member function Mail_RFC822::parseAddressList is being called statically as shown below. $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false); This object needs to be instantiated in order to use this member function as shown below. This avoids unnecessary PHP warnings. $Mail_RFC822 = new Mail_RFC822(); $addresses = $Mail_RFC822->parseAddressList($recipients, 'localhost', false); Test script: --------------- <?php require_once 'Mail.php'; require_once 'PEAR.php'; define('SMTP_SERVER', ''); define('SMTP_PORT', 25); define('USERNAME', 'someone'); define('PASSWORD', '1LamePassword'); $objMail = new Mail; $objSMTP = $objMail->factory('smtp', array ( 'host' => SMTP_SERVER, 'port' => SMTP_PORT, 'auth' => true, 'username' => USERNAME, 'password' => PASSWORD)); $strFromEmail = ""; $strFromName = "Some One"; $strToAddress = ""; $aHeaders['From'] = "{$strFromName} <{$strFromEmail}>"; $aHeaders['To'] = $strToAddress; $aHeaders['Subject'] = "Test Message"; $objMail = $objSMTP->send($strToAddress, $aHeaders, "Hello world."); if(PEAR::isError($objMail)) { print "Error sending user message: " . $objMail->getMessage(); return false; } else return true; ?> Expected result: ---------------- ERROR: #2048 - Non-static method Mail_RFC822::parseAddressList() should not be called statically, assuming $this from incompatible context occurred in Mail.php on line 253


 [2010-09-14 17:43 UTC] myguitar82 (Brandon Liles)
 [2011-01-15 01:09 UTC] alec (Aleksander Machniak)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alec -Roadmap Versions: +Roadmap Versions: 1.2.1
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.