Home » HTTP » HTTP_Upload » Bug #6752
'Only variable references should be returned by reference' PHP notice
Details
| Submitted | 2006-02-11 15:44 UTC |
|---|---|
| From | koto at webworkers dot pl |
| Assigned | wenz |
| Status | Closed |
| Package | HTTP_Upload |
| PHP Version | 5.1.2 |
| OS | winxp |
| Roadmaps | (Not assigned) |
Comments
[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;
}