The Variable-Related functions provide tools for inspecting, transforming, serializing, and deleting variables.
Overview PHP's variable-related functions are a key part of the language. Skilled programmers rely on them extensively to build robust code that uses type-checking. Functions such as var_dump() and print_r() are also invaluable when debugging.
Here is a quick, task-based overview of the function group:
Cast a value from one type to another: doubleval() , intval() , strval()
Determine the type of a variable: is_array() , is_bool() , is_double() , is_float() , is_int() , is_integer() , is_long() , is_null() , is_numeric() , is_object() , is_real() , is_resource() , is_scalar() , is_string() , get_resource_type() , gettype()
Gather information about variables: empty() , get_defined_vars() , isset() , print_r() , var_dump()
Serialize and unserialize variables: serialize() , unserialize()
Configuring Variable-Related FunctionsThe following configuration directives affect how PHP handles variables.
| Directive Name | Value Type | Description |
|---|---|---|
| error_reporting | integer |
If the error-reporting level set includes E_NOTICE, the use of uninitialized variables will be reported. |
Installing Variable-Related Functions Support These functions are built into PHP by default and can only be disabled by editing the source code and recompiling or by using the disable_functions directive in php.ini.
Additional InformationFor more information on variables, types, and the variable -related functions, see:
The PHP web site ( http://php.net)