ini_restore()

ini_restore() — Restores the value of a configuration option.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

Signature

ini_restore(string $option): void

Parameters

ParameterTypeWhat it takes
$optionstringThe configuration option name.

Return value

No value is returned.

Example

A runnable snippet:

$setting = 'html_errors'; echo 'Current value for \'' . $setting . '\': ' . ini_get($setting), PHP_EOL; ini_set($setting, ini_get($setting) ? 0 : 1); echo 'New value for \'' . $setting . '\': ' . ini_get($setting), PHP_EOL; ini_restore($setting); echo 'Original value for \'' . $setting . '\': ' . ini_get($setting), PHP_EOL;

Output:

Current value for 'html_errors': 1 New value for 'html_errors': 0 Original value for 'html_errors': 1

See also

ini_get(), ini_get_all(), ini_set()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page ini_restore() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.