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