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