#33822 [Opn->Bgs]: Error : Only variables can be passed by reference
| From: | tony2001@php.net | Date: | Fri, 22 Jul 2005 14:32:55 +0000 |
| Subject: | #33822 [Opn->Bgs]: Error : Only variables can be passed by reference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-82324@lists.php.net to get a copy of this message | ||
ID: 33822
Updated by: tony2001@php.net
Reported By: stochnagara at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows XP
PHP Version: 5CVS-2005-07-22 (dev)
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
See #33643.
Previous Comments:
------------------------------------------------------------------------
[2005-07-22 15:00:04] stochnagara at hotmail dot com
Description:
------------
A strange bug with references is present in today's snaphshot (10:30)
of PHP 5.1.
I call it bug because many old PHP scripts don't work anymore.
The problem is that passing an argument to a function expecting a
reference when this argument retreived by another function call, causes
a Fatal Error.
With PHP 5.0.4 it works fine.
Reproduce code:
---------------
<?
function a (&$str) {
echo 'hi';
}
function b ($str) {
return $str . 'hi';
}
echo a (b('1'));
Expected result:
----------------
hi
Actual result:
--------------
Fatal error: Only variables can be passed by reference in C:\Program
Files\Apache Group\...\test.php on line 11
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33822&edit=1