Re: Returning an object

From: Date: Fri, 07 May 2004 21:33:18 +0000
Subject: Re: Returning an object
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-185687@lists.php.net to get a copy of this message
"Curt Zirzow" <php-general@zirzow.dyndns.org> wrote in message news:20040507022512.GX26014@bagend.shire... > * Thus wrote Aidan Lister (aidan@php.net): > > How _should_ this be done? In terms of "best practice". > > > > <?php > > function foobar () > > { > > return new SomeObject; > > } > > ?> > > > > Or: > > > > <?php > > function barfoo () > > { > > $tempvar = new SomeObject; > > return $tempvar > > } > > ?> > > I'm not exactly sure what your looking for, this is like asking > what is better: > > $a = 'foo'; > echo $a; > > or > echo 'foo'; > > if tou want my opinion it should be written like this: > <?php > > /* > * Create an instance of SomeObject > */ > function foobar() { > return new SomeObject; > } > > > > > Please don't reply if you really, really don't know what you are talking > > about. > > What kind of requirement is this? Anyone can reply your email and > they will do so if they feel like it. > The reason I added that at the bottom was to stop people like yourself replying, not that I don't appreciate your advice, I think you're simply not aware of the facts. > > Curt > -- > "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#185687) next »