1--TEST--
2readline_callback_handler_install(): Basic test
3--EXTENSIONS--
4readline
5--SKIPIF--
6<?php if (!function_exists('readline_callback_handler_install')) die("skip");
7if (READLINE_LIB == "libedit") die("skip readline only");
8?>
9--FILE--
10<?php
11
12function foo() {
13    readline_callback_handler_remove();
14}
15
16var_dump(readline_callback_handler_install('testing: ', 'foo'));
17try {
18    var_dump(readline_callback_handler_install('testing: ', 'foobar!'));
19} catch (\TypeError $e) {
20    echo $e->getMessage() . \PHP_EOL;
21}
22
23?>
24--EXPECT--
25testing: bool(true)
26readline_callback_handler_install(): Argument #2 ($callback) must be a valid callback, function "foobar!" not found or invalid function name
27