Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

readline_info

Description

The readline_info of Readline for PHP gets/sets various internal readline variables.

Syntax

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

Parameters

var_name

A variable name.

value

If provided, this will be the new value of the setting.

Return

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.

Examples

1 · void

<?

$return = readline_info();

print_r($return);

?>
Array
(
    [line_buffer] => 
    [point] => 0
    [end] => 0
    [mark] => 0
    [done] => 0
    [pending_input] => 0
    [prompt] => 
    [terminal_name] => 
    [completion_append_character] =>  
    [completion_suppress_append] => 
    [library_version] => 6.2
    [readline_name] => other
    [attempted_completion_over] => 0
)

2 · var_name

<?

$var_name = "library_version";

$return = readline_info($var_name);

echo $return;

?>
6.2

3 · value

<?

$var_name = "readline_name";
$value = "myvalue";

$return = readline_info($var_name, $value);

echo $return;

?>
other
HomeMenu