ID: 33558 User updated by: l dot alberton at quipo dot it Reported By: l dot alberton at quipo dot it -Status: Bogus +Status: Open Bug Type: Scripting Engine problem Operating System: Irrelevant PHP Version: 4.4.0RC1 New Comment:
>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. Previous Comments: ------------------------------------------------------------------------ [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