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 not for windows');
8}
9?>
10--FILE--
11<?php
12
13$name = tempnam('/tmp', '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(21) "_HiStOrY_V2_
28foo
29
301
31
32"
33