Options & Info

11 entries

extension_loaded / get_loaded_extensions Function Extension introspection: extension_loaded probes one extension by name (compiled in or shared-loaded), get_loaded_extensions lists every loaded extension; mirrors hash_algos' inventory-consumer pattern — probe before use is step one of portable PHP. ini_get Function Reads a runtime config directive; returns a string ("0"/"1" for boolean switches) or false when the directive doesn't exist. ini_get_all Function Fetches all (or one extension's) runtime config directives at once; each item carries global value, local value and modification access. ini_parse_quantity Function PHP 8.2+: parses an ini shorthand value into bytes (the same parser behind memory_limit="128M"); k/M/G suffixes plus 0x/0b/0o/leading-0 bases; unparseable input or an invalid suffix raises E_WARNING and returns a best-effort value. ini_set Function Modifies a runtime config directive and returns its old value; only PHP_INI_ALL directives can change, false when it can't. php_ini_loaded_file / php_ini_scanned_files Function Config-file path introspection: php_ini_loaded_file returns the full path of the php.ini this process actually loaded (false when none), php_ini_scanned_files returns the comma-separated list of additional ini files parsed from the scan directory (configure --with-config-file-scan-dir) or false; pairs with ini_get — path introspection answers "where values come from", ini_get answers "what the values are". php_sapi_name Function Returns the lowercase name of the hosting interface (SAPI) - "cli", "fpm-fcgi", "apache2handler", etc.; the PHP_SAPI constant holds the same value, letting one script tell its CLI and web forms apart. php_uname Function System identity: modes 's'/'n'/'r'/'v'/'m' mirror the POSIX utsname fields sysname/nodename/release/version/machine; with no argument it returns the five glued together. Use PHP_OS_FAMILY for a simple OS-family check. phpinfo Function Dumps a full introspection report of the current PHP (config, extensions, env vars, license, ...), section-selectable via INFO_* constants. set_time_limit Function Resets the script's maximum execution time in seconds (the counter restarts at the call); 0 means unlimited; on timeout the script is terminated with a fatal error. version_compare Function Compares two version strings numerically, recognizing dev/a/b/RC/pl/p suffixes; with a third operator argument it returns a bool directly.