1--TEST--
2readline_write_history(): Basic test
3--EXTENSIONS--
4readline
5--SKIPIF--
6<?php if (!function_exists('readline_add_history')) die("skip");
7if (READLINE_LIB != "libedit") die("skip libedit only");
8if(substr(PHP_OS, 0, 3) == 'WIN' ) {
9    die('skip not for windows');
10}
11if (getenv('SKIP_REPEAT')) die("skip readline has global state");
12?>
13--FILE--
14<?php
15
16$name = tempnam('/tmp', 'readline.tmp');
17
18readline_add_history('foo');
19readline_add_history('');
20readline_add_history(1);
21readline_write_history($name);
22
23var_dump(file_get_contents($name));
24
25unlink($name);
26
27?>
28--EXPECT--
29string(20) "_HiStOrY_V2_
30foo
31
321
33"
34