AW: [PHP-DEV] return /* by reference */ new Foo() in PHP4
| From: | Matthias Pigulla | Date: | Sun, 09 Oct 2005 12:04:28 +0000 |
| Subject: | AW: [PHP-DEV] return /* by reference */ new Foo() in PHP4 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-19531@lists.php.net to get a copy of this message | ||
Sorry, Olli, if that kind of ignores your statements, but I would like
not to distract from the issue. IIRC, what you suggested is called
"boxing" in C# and would lead too far here.
I wanted to focus only on the "return new ..." case and only on PHP4, as
"return new" is a very special case. This particular construct is really
unambiguous and the workaround on the PHP language level is really
nonsense.
As to the notices, I will gladly accept them and take them as a helpful
pointers when "fixing" my "broken" code. The problem is that this
particular case causes a lot of "white noise" notices (at least in
heavily OO apps), as IMHO "return new" is not something that needs to be
fixed by me.
I have been strolling around in a lot of places where the changed
behaviour is being discussed, but I haven't seen a sound rationale for
*this particular* case yet.
Kind regards,
Matthias