xref: /PHP-5.6/ext/sysvshm/tests/006.phpt (revision 6651864c)
1--TEST--
2shm_remove_var() tests
3--SKIPIF--
4<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
5--FILE--
6<?php
7
8$key = ftok(__FILE__, 't');
9$s = shm_attach($key, 1024);
10
11shm_put_var($s, 1, "test string");
12
13var_dump(shm_remove_var());
14var_dump(shm_remove_var(-1, -1));
15var_dump(shm_remove_var($s, -10));
16
17var_dump(shm_get_var($s, 1));
18
19var_dump(shm_remove_var($s, 1));
20var_dump(shm_get_var($s, 1));
21
22var_dump(shm_remove_var($s, 1));
23var_dump(shm_get_var($s, 1));
24
25shm_remove($s);
26echo "Done\n";
27?>
28--EXPECTF--
29
30Warning: shm_remove_var() expects exactly 2 parameters, 0 given in %s006.php on line %d
31NULL
32
33Warning: shm_remove_var() expects parameter 1 to be resource, integer given in %s006.php on line %d
34NULL
35
36Warning: shm_remove_var(): variable key -10 doesn't exist in %s006.php on line %d
37bool(false)
38string(11) "test string"
39bool(true)
40
41Warning: shm_get_var(): variable key 1 doesn't exist in %s006.php on line %d
42bool(false)
43
44Warning: shm_remove_var(): variable key 1 doesn't exist in %s006.php on line %d
45bool(false)
46
47Warning: shm_get_var(): variable key 1 doesn't exist in %s006.php on line %d
48bool(false)
49Done
50