warning with nested calls to functions returning by reference
| Bug #33558 | warning with nested calls to functions returning by reference | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2005-07-03 23:04 UTC | Modified: | 2005-08-15 12:47 UTC |
|
||||||||||
| From: | l dot alberton at quipo dot it | Assigned: | derick (profile) | |||||||||||
| Status: | Closed | Package: | Scripting Engine problem | |||||||||||
| PHP Version: | 4.4.0RC1 | OS: | * | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2005-07-03 23:04 UTC] l dot alberton at quipo dot it
Description:
------------
When a function which returns a reference calls another function which returns a reference, the engine complains because the outer function does not return a variable reference.
It happens with PHP4.4.0RC2 too.
Reproduce code:
---------------
<?php
function & foo() {
$var = 'a';
return $var;
}
function & bar() {
return foo();
}
$a =& bar();
?>
Expected result:
----------------
no NOTICEs
Actual result:
--------------
Notice: Only variable references should be returned by reference in test_ref.php on line 8
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-07-03 23:08 UTC] derick@php.net
[2005-07-03 23:56 UTC] l dot alberton at quipo dot it
[2005-08-15 12:47 UTC] derick@php.net