ini_alter()

ini_alter() — Alias of ini_set().

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.

ini_alter() is an alias of ini_set(): same parameters, same return value.

Signature

ini_alter(string $option, string|int|float|bool|null $value): string|false

Parameters

ParameterTypeWhat it takes
$optionstringNot all the available options can be changed using ini_set(). There is a list of all available options in the appendix.
$valuestring|int|float|bool|nullThe new value for the option.

Return value

Returns the old value on success, false on failure.

Example

A runnable snippet:

echo ini_get('display_errors'); if (!ini_get('display_errors')) { ini_set('display_errors', '1'); } echo ini_get('display_errors');

All PHP 8.5 built-in functions

Reference card built from the PHP manual page ini_alter() (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.