#33643 [Opn->Bgs]: Fatal error: Only variables can be passed by reference
| From: | iliaa@php.net | Date: | Mon, 11 Jul 2005 15:32:32 +0000 |
| Subject: | #33643 [Opn->Bgs]: Fatal error: Only variables can be passed by reference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81676@lists.php.net to get a copy of this message | ||
ID: 33643
Updated by: iliaa@php.net
Reported By: Jason at hybd dot net
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
PHP Version: 5.1.0b2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
.
Previous Comments:
------------------------------------------------------------------------
[2005-07-11 13:06:46] Jason at hybd dot net
Description:
------------
This bug is a rehash of 33516, but I can't reopen as I'm not the
original author.
It seems like you can not pass tempories to function / method
parameters.
<?php
class Foo {
public static function bar() {
return array('a' => '1234567890');
}
}
$tmp = Foo::bar();
$var = array_pop($tmp);
?>
Seems to work, but it shouldn't be down to the PHP user (imho) to
implement this as this change in PHP 5.1 breaks a lot of existing code.
Reproduce code:
---------------
<?php
class Foo {
public static function bar() {
return array('a' => '1234567890');
}
}
$var = array_pop(Foo::bar());
?>
Expected result:
----------------
$var = '1234567890';
Foo::bar() gets placed in temporary variable
Actual result:
--------------
Fatal error: Only variables can be passed by reference
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33643&edit=1