note 69611 deleted from language.variables.scope by crell

From: Date: Thu, 31 Mar 2022 19:34:20 +0000
Subject: note 69611 deleted from language.variables.scope by crell
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-217919@lists.php.net to get a copy of this message
Note Submitter: alan ---- Using the global keyword inside a function to define a variable is essentially the same as passing the variable by reference as a parameter: <?php somefunction(){ global $var; } ?> is the same as: <?php somefunction(& $a) { } ?> The advantage to using the keyword is if you have a long list of variables needed by the function - you dont have to pass them every time you call the function.

« previous php.notes (#217919) next »