1--TEST-- 2readline_write_history(): Basic test 3--SKIPIF-- 4<?php if (!extension_loaded("readline") || !function_exists('readline_add_history')) die("skip"); 5if (READLINE_LIB != "libedit") die("skip libedit only"); 6if(substr(PHP_OS, 0, 3) != 'WIN' ) { 7 die('skip windows only test'); 8} 9?> 10--FILE-- 11<?php 12 13$name = tempnam(sys_get_temp_dir(), 'readline.tmp'); 14 15readline_add_history('foo'); 16readline_add_history(''); 17readline_add_history(1); 18readline_add_history(NULL); 19readline_write_history($name); 20 21var_dump(file_get_contents($name)); 22 23unlink($name); 24 25?> 26--EXPECT-- 27string(6) "foo 281 29" 30