xref: /PHP-8.3/ext/sysvshm/tests/003.phpt (revision 74859783)
1--TEST--
2shm_detach() tests
3--EXTENSIONS--
4sysvshm
5--SKIPIF--
6<?php
7
8if (!function_exists('ftok')){ print 'skip'; }
9?>
10--FILE--
11<?php
12
13$key = ftok(__DIR__."/003.phpt", 'q');
14
15$s = shm_attach($key);
16
17var_dump(shm_detach($s));
18try {
19    shm_detach($s);
20} catch (Error $exception) {
21    echo $exception->getMessage() . "\n";
22}
23
24try {
25    shm_remove($s);
26} catch (Error $exception) {
27    echo $exception->getMessage() . "\n";
28}
29
30echo "Done\n";
31?>
32--CLEAN--
33<?php
34
35$key = ftok(__DIR__."/003.phpt", 'q');
36$s = shm_attach($key);
37shm_remove($s);
38
39?>
40--EXPECT--
41bool(true)
42Shared memory block has already been destroyed
43Shared memory block has already been destroyed
44Done
45