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 : 3 + 1 = ?

 
 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!