readline_info

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

readline

readline_add_history

readline_callback_handler_install

readline_callback_handler_remove

readline_callback_read_char

readline_clear_history

readline_completion_function

readline_list_history

readline_on_new_line

readline_read_history

readline_redisplay

readline_write_history

PHP

Home Menu