forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path003.phpt
54 lines (40 loc) · 1.2 KB
/
003.phpt
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
43
44
45
46
47
48
49
50
51
52
53
54
--TEST--
shm_detach() tests
--SKIPIF--
<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
--FILE--
<?php
$key = ftok(dirname(__FILE__)."/003.phpt", 'q');
var_dump(shm_detach());
var_dump(shm_detach(1,1));
$s = shm_attach($key);
var_dump(shm_detach($s));
var_dump(shm_detach($s));
shm_remove($s);
var_dump(shm_detach(0));
var_dump(shm_detach(1));
var_dump(shm_detach(-1));
echo "Done\n";
?>
--CLEAN--
<?php
$key = ftok(dirname(__FILE__)."/003.phpt", 'q');
$s = shm_attach($key);
shm_remove($s);
?>
--EXPECTF--
Warning: shm_detach() expects exactly 1 parameter, 0 given in %s003.php on line %d
NULL
Warning: shm_detach() expects exactly 1 parameter, 2 given in %s003.php on line %d
NULL
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
Warning: shm_detach() expects parameter 1 to be resource, integer given in %s003.php on line %d
NULL
Warning: shm_detach() expects parameter 1 to be resource, integer given in %s003.php on line %d
NULL
Warning: shm_detach() expects parameter 1 to be resource, integer given in %s003.php on line %d
NULL
Done