search for in the  
<ResourcesCreating Constants>
Last updated: Thu, 19 May 2005

Macros for Automatic Global Variable Creation

In addition to the macros discussed earlier, a few macros allow easy creation of simple global variables. These are nice to know in case you want to introduce global flags, for example. This is somewhat bad practice, but Table Table 53-5 describes macros that do exactly this task. They don't need any zval allocation; you simply have to supply a variable name and value.

Table 53-5. Macros for Global Variable Creation

MacroDescription
SET_VAR_STRING(name, value)Creates a new string.
SET_VAR_STRINGL(name, value, length)Creates a new string of the specified length. This macro is faster than SET_VAR_STRING and also binary-safe.
SET_VAR_LONG(name, value)Creates a new long.
SET_VAR_DOUBLE(name, value)Creates a new double.


User Contributed Notes
Macros for Automatic Global Variable Creation
There are no user contributed notes for this page.

<ResourcesCreating Constants>
 Last updated: Thu, 19 May 2005
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: The Server Pages
Last updated: Thu May 19 17:35:34 2005 CDT