summaryrefslogtreecommitdiff
path: root/ext/sysvshm/tests/003.phpt
blob: 9456891dab27517fc5c0593d3799056593fc3325 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--TEST--
shm_detach() tests
--SKIPIF--
<?php
if (!extension_loaded("sysvshm")){ print 'skip'; }
if (!function_exists('ftok')){ print 'skip'; }
?>
--FILE--
<?php

$key = ftok(__DIR__."/003.phpt", 'q');

$s = shm_attach($key);

var_dump(shm_detach($s));
try {
    shm_detach($s);
} catch (Error $exception) {
    echo $exception->getMessage() . "\n";
}

try {
    shm_remove($s);
} catch (Error $exception) {
    echo $exception->getMessage() . "\n";
}

echo "Done\n";
?>
--CLEAN--
<?php

$key = ftok(__DIR__."/003.phpt", 'q');
$s = shm_attach($key);
shm_remove($s);

?>
--EXPECT--
bool(true)
Shared memory block has already been destroyed
Shared memory block has already been destroyed
Done