Re: Small question about performance

From: Date: Thu, 15 Mar 2012 19:14:20 +0000
Subject: Re: Small question about performance
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-58971@lists.php.net to get a copy of this message
thanks exactly what i assumed, but better to be sure instead wasting somewhere ressources without need :-) Am 15.03.2012 20:10, schrieb Michael Stowe: > The $b on this example would be freed as it is in the function's scope, and > not the global scope. The exception to this would be a static variable > within a function, which would persist for future use within the function. > > Class properties on the other hand will persist until the object is > destructed, or until they are unset. > > So for your example, > function test() { > $b = 'apple'; > return $b; > } > > You would not need to unset $b as it resides temporarily within the > function, and does not persist outside of the function.

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.internals (#58971) next »