[pmwiki-users] $FarmD scope

Patrick R. Michaud pmichaud at pobox.com
Sat Aug 19 00:01:21 CDT 2006

On Fri, Aug 18, 2006 at 10:32:32PM -0500, JB wrote:
> Is the $FarmD variable local in scope?
> It does not seem to work inside a php function.
> I thought it might be global.

Variables in PHP are local to functions unless explicitly
declared global via the "global" statement.

There are a few exceptions, called "superglobals", such as $_POST,
$_GET, $_SERVER, $GLOBALS, etc., which are global in every
scope.  But other than those, a variable is local to a function
unless declared global.


More information about the pmwiki-users mailing list