readline_info()

readline_info() — Gets/sets various internal readline variables.

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

readline_info(?string $var_name = null, int|string|bool|null $value = null): mixed

Parameters

ParameterTypeWhat it takes
$var_name?stringA variable name.
$valueint|string|bool|nullIf provided, this will be the new value of the setting.

Return value

If called with no parameters, this function returns an array of values for all the settings readline uses. The elements will be indexed by the following values: done, end, erase_empty_line, library_version, line_buffer, mark, pending_input, point, prompt, readline_name, and terminal_name. The array will only contain those elements which are supported by the library used to built the readline extension. If called with one or two parameters, the old value is returned.

Example

The PHP manual ships no example for readline_info(); the signature and the parameter table above are the contract.

Changelog

VersionChange
8.0.0var_name and value are nullable now.

All PHP 8.5 built-in functions

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