PHP
PHP Information
Show installed PHP version
php -vList active compiled php modules
php -mShow php configuration and environment information
php -iRun Script
Manually execute a PHP script
php -q <script>PHP Interactive Shell
Start interactive shell from the command line
php -aExit interactive shell
quit
CTRL+CSimple PHP Server
Start a server in the current directory
Output Strings
Output readable/detailed debugging information about a variable
Outputs parsable string representation of variable
Output string
Output formatted string
Superglobals
Context, configuration and environment variables available in all scopes
$GLOBALS: All variables available in global scope$_ENV: Environment variables$_SERVER: Server and execution environment information$_SESSION: Session variables available to the current script$_COOKIES: Cookie variables available to the current script via HTTP Cookies$_FILES: Items uploaded to the current script via the HTTP POST method$_GET: Variables passed to the current script via URL GET parameters$_POST: Variables passed to the current script via the HTTP POST method$_REQUEST: All variables from$_GET,$_POSTand$_COOKIE
Note: Order and availability of $_ENV (E), $_GET (G), $_POST (P), $_COOKIES (C), $_SERVER (S) is set by variables_order setting in php.ini (Default: variables_order = "EGPCS")
Environment Values
Directly query OS environment variables
Extensions
Check if extension is loaded (eg. 'gd' image library)
Introspection
Class Introspection
Get declared classes, traits and interfaces
Get defined vars, constants and functions
Check if a class exists
Get the parent classes, interfaces and traits a class uses
Get parent class, methods or vars from a class
Object Introspection
Test for an object and get the class an object belongs to
Check if a method or property exists on an object
Get object vars and object parent class
Get the type of a variable
Test if an object is a particular class
Array Introspection
Output array keys
Typecast object to array and output list of keys
Last updated