summaryrefslogtreecommitdiff
path: root/ext/sysvshm/tests/003.phpt
blob: fd81c48a67a86c68534c65656a30eb02f63b5858 (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
--TEST--
shm_detach() tests
--SKIPIF--
<?php
if (!extension_loaded("sysvshm")){ print 'skip'; }
if (!function_exists('ftok')){ print 'skip'; }
?>
--FILE--
<?php

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

$s = shm_attach($key);

var_dump(shm_detach($s));
var_dump(shm_detach($s));
shm_remove($s);

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

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

?>
--EXPECTF--
bool(true)

Warning: shm_detach(): supplied resource is not a valid sysvshm resource in %s003.php on line %d
bool(false)

Warning: shm_remove(): supplied resource is not a valid sysvshm resource in %s003.php on line %d
Done