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