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

Bug #2098 try() function of Body.php incompatible with PHP5
Submitted: 2004-08-10 00:17 UTC
From: troy at versiontwo dot com dot au Assigned: quipo
Status: Closed Package: Mail_Queue
PHP Version: 5.0.0 OS: Fedora Core 2
Roadmaps: (Not assigned)    
Subscription  


 [2004-08-10 00:17 UTC] troy at versiontwo dot com dot au
Description: ------------ Pretty simple one this. Just need to rename the try() function in the Queue/Body.php file. Last function (line 330). This function name conflicts with the next error handling features of php5.

Comments

 [2004-08-17 13:30 UTC] quipo
Last time I checked, "try" was not a reserved word. Did you encounter any problem with the class? Since it's a class method and not a global function, it shouldn't cause conflicts, but I admit I haven't tried yet. Can you provide some feedback? TIA, -- Lorenzo Alberton http://pear.php.net/user/quipo
 [2004-08-17 13:53 UTC] troy at versiontwo dot com dot au
I could only find a list of reserved words for php4. However, I can assure you that the following words are now reserved for php5: try, catch, throw, exception, public, private, protected, abstract, interface and final. Example: class TryTest { private $value; public function __construct($someValue) { $this->try($someValue); } private function try($value) { $this->value = $value; } } $tt = new TryTest('Test'); Causes the following error: Parse error: parse error, unexpected T_TRY, expecting T_STRING
 [2004-08-17 14:36 UTC] quipo
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. -- I renamed the method, thanks for your feedback.