summaryrefslogtreecommitdiff
path: root/ext/sysvshm/tests/003.phpt
blob: a7fe128aa5697f3f2e926ccff3b9912fe67f703d (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
--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 {
    var_dump(shm_detach($s));
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}
try {
    shm_remove($s);
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}

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

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

?>
--EXPECT--
bool(true)
shm_detach(): supplied resource is not a valid sysvshm resource
shm_remove(): supplied resource is not a valid sysvshm resource
Done