xref: /PHP-5.5/ext/sysvshm/tests/007.phpt (revision 6651864c)
1--TEST--
2shm_remove() 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
11var_dump(shm_remove());
12var_dump(shm_remove(-1));
13var_dump(shm_remove(0));
14var_dump(shm_remove(""));
15
16var_dump(shm_remove($s));
17var_dump(shm_remove($s));
18
19shm_detach($s);
20var_dump(shm_remove($s));
21
22echo "Done\n";
23?>
24--EXPECTF--
25
26Warning: shm_remove() expects exactly 1 parameter, 0 given in %s007.php on line %d
27NULL
28
29Warning: shm_remove() expects parameter 1 to be resource, integer given in %s007.php on line %d
30NULL
31
32Warning: shm_remove() expects parameter 1 to be resource, integer given in %s007.php on line %d
33NULL
34
35Warning: shm_remove() expects parameter 1 to be resource, string given in %s007.php on line %d
36NULL
37bool(true)
38bool(true)
39
40Warning: shm_remove(): %d is not a valid sysvshm resource in %s007.php on line %d
41bool(false)
42Done
43
44