ID:               33558
 Updated by:       [EMAIL PROTECTED]
 Reported By:      l dot alberton at quipo dot it
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Irrelevant
 PHP Version:      4.4.0RC1
 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

You can only return variable by reference, not function's results.
(This never worked correctly before anyway, now you just get a nice
notice about it so that you can fix your code).


Previous Comments:
------------------------------------------------------------------------

[2005-07-03 23:04:47] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33558&edit=1

Reply via email to