xref: /PHP-7.0/ext/sysvshm/tests/007.phpt (revision b8ea9918)
1--TEST--
2shm_remove() tests
3--SKIPIF--
4<?php
5if (!extension_loaded("sysvshm")){ print 'skip'; }
6if (!function_exists('ftok')){ print 'skip'; }
7?>
8--FILE--
9<?php
10
11$key = ftok(__FILE__, 't');
12$s = shm_attach($key, 1024);
13
14var_dump(shm_remove());
15var_dump(shm_remove(-1));
16var_dump(shm_remove(0));
17var_dump(shm_remove(""));
18
19var_dump(shm_remove($s));
20
21shm_detach($s);
22var_dump(shm_remove($s));
23
24echo "Done\n";
25?>
26--EXPECTF--
27
28Warning: shm_remove() expects exactly 1 parameter, 0 given in %s007.php on line %d
29NULL
30
31Warning: shm_remove() expects parameter 1 to be resource, integer given in %s007.php on line %d
32NULL
33
34Warning: shm_remove() expects parameter 1 to be resource, integer given in %s007.php on line %d
35NULL
36
37Warning: shm_remove() expects parameter 1 to be resource, string given in %s007.php on line %d
38NULL
39bool(true)
40
41Warning: shm_remove(): supplied resource is not a valid sysvshm resource in %s007.php on line %d
42bool(false)
43Done
44
45