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

Bug #6752 'Only variable references should be returned by reference' PHP notice
Submitted: 2006-02-11 15:44 UTC
From: koto at webworkers dot pl Assigned: wenz
Status: Closed Package: HTTP_Upload (version 0.9.1)
PHP Version: 5.1.2 OS: winxp
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 : 25 - 16 = ?

 
 [2006-02-11 15:44 UTC] koto at webworkers dot pl
Description: ------------ Using the package with php 4.4.x or php 5 could result in 'only variable references should be returned by reference' PHP Notice due to using syntax: return new ..... in functions that are defined to return a reference (function &name {} ) Simple fix is to apply a patch included below. Test script: --------------- --- c:\php\PEAR\HTTP\Upload.php 2006-02-11 15:02:47.956125000 +0100 +++ c:\doc\www\b2boss\admin\includes\PEAR\HTTP\Upload.php 2006-02-11 15:20:37.596750000 +0100 @@ -364,7 +364,8 @@ // warn him about it with a faked upload - return new HTTP_Upload_File( - '_error', null, - null, null, - null, 'DEV_NO_DEF_FILE', - $this->lang); + $fake =& new HTTP_Upload_File( + '_error', null, + null, null, + null, 'DEV_NO_DEF_FILE', + $this->lang); + return $fake; } @@ -385,3 +386,4 @@ { - return $this->raiseError('BAD_FORM'); + $bad_form =& $this->raiseError('BAD_FORM'); + return $bad_form; }

Comments

 [2006-02-11 17:47 UTC] wenz
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. this (and some additional occurrences) should be fixed in CVS now. Does it work for you?