Variables & Constants

9 entries

constant Function Returns the value of a constant given its name (a runtime reflection lookup for constants). define Function Defines a named constant at runtime (complementing the const keyword). empty Function Checks whether a variable is empty (a language construct: "", 0, "0", null, false, [] and undefined all count as empty). get_defined_vars Function Returns every defined variable in the current scope (in a function: parameters plus in-body variables; globally, superglobals too) - a dynamic-language introspection feature. getenv Function Reads process environment variables: by name (false when absent; omit the name for the whole environment array); values written by putenv are immediately visible to later reads in the same process. gettype Function Returns the variable's type name string (historical names: float as double, int as integer); prefer get_debug_type for debugging. isset Function Determines whether a variable is declared and is not null (a language construct that accepts multiple variables). putenv Function Mutates this process's environment block with "NAME=value" syntax (add or overwrite); a bare "NAME" without "=" deletes. The change affects only this process and children spawned afterwards, and is restored at the end of the request (web context). unset Function Destroys the given variable or array key (a language construct that accepts multiple targets).