> > So, in case of "return new", wouldn't it make sense to remove the 
> > warning as the code is 'legal'? And please, don't start a new "it's 
> > just a friendly notice" flame war.
> 
>      It's just a notice, tune your error_reporting level accordingly.

Sorry, but that is just a stupid killer argument. I thought I had
written something like "please, don't start a new *it's just a friendly
notice* flame war". 

May I conclude that what you really want to say is:

"Yes, return /*byref*/ new Foo() _is_ bad code _unless_ inside Foo's
constructor, $this is passed around and somebody somewhere stores yet
another reference to it. Accept that you wrote broken code: return new
Foo() is wrong, it needs to be return $tmp =& new Foo()."

Shaking his head,
Matthias

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to