RE: [PHP] Return value efficiency question

From: Date: Wed, 10 Mar 2004 13:51:46 +0000
Subject: RE: [PHP] Return value efficiency question
Groups: php.general 
Request: Send a blank email to php-general+get-180018@lists.php.net to get a copy of this message
On 10 March 2004 13:48, Burhan Khalid wrote: > Kelly Hallman wrote: > > Consider this method: > > > > function xyz() { > > return $this->data = unserialize($this->serial); } > > > > Maybe I'm just being stupid, but wouldn't that simply return true if > the assignment was successful, and false otherwise? Nope. The value of an assignment expression is the value assigned, so that will return whatever was assigned into $this->data. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#180018) next »