ID: 44565 User updated by: wursttrooper at gmx dot de Reported By: wursttrooper at gmx dot de Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.2.5 New Comment:
alright I see that was not correctly coded by myself. But the error message was missleading. I just could not make any sense out of the "write context". I would have expected the deprecation warning as I knew it from before, when things were passed by reference at the call. Previous Comments: ------------------------------------------------------------------------ [2008-03-29 19:41:21] [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 See: - http://docs.php.net/manual/en/language.references.pass.php ------------------------------------------------------------------------ [2008-03-29 16:42:01] wursttrooper at gmx dot de Description: ------------ When using a func return value by reference as constructor argument, produces Fatal error: Can't use method return value in write context in D:\xampplite\htdocs\test\writectx.php on line 22 removing by ref '&' symbol lets code execute. Reproduce code: --------------- <? class MyClass { function func1() { return "ret func1"; } } class MyClass2 { function __construct( $str, $obj ) { } } $obj= new MyClass(); /****************** Fatal error: Can't use method return value in write context in D:\xampplite\htdocs\test\writectx.php on line 22 ******************/ $c2 = new MyClass2("sf",&$obj->func1()); /****************** works ******************/ $c2 = new MyClass2("sf",$obj->func1()); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44565&edit=1
