ID:               33558
 Updated by:       [EMAIL PROTECTED]
 Reported By:      l dot alberton at quipo dot it
-Status:           Assigned
+Status:           Closed
 Bug Type:         Scripting Engine problem
 Operating System: *
 PHP Version:      4.4.0RC1
 Assigned To:      derick
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




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

[2005-07-18 10:02:55] [EMAIL PROTECTED]

So that I don't forget to backport this to 4.4.1.

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

[2005-07-18 09:42:54] [EMAIL PROTECTED]

Fixed in CVS HEAD and PHP_5_0.

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

[2005-07-03 23:56:32] l dot alberton at quipo dot it

>You can only return variable by reference, not function's results.

even if the function result *is* a reference?


> (This never worked correctly before anyway, now you just get a nice
> notice about it so that you can fix your code).

the fact that it never worked doesn't mean it is not a bug... quite
frankly I don't see any reason why it's my code that need fixing and
not the engine itself.
I may be stubborn, but I'm not convinced at all. I still think that I'm
not doing anything wrong here, and if it doesn't work it's because of an
engine limitation, not because of a fault of my code.

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

[2005-07-03 23:08:39] [EMAIL PROTECTED]

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).

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

[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