summaryrefslogtreecommitdiff
path: root/ext/shmop/tests/shmop_open_private.phpt
blob: df969885c9e7145fd923a140896048aa72531db4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
shmop_open with IPC_PRIVATE creates private SHM
--SKIPIF--
<?php
if (!extension_loaded('shmop')) die('skip shmop extension not available');
?>
--FILE--
<?php
$write = 'test';

$shm1 = shmop_open(0, 'c', 0777, 1024);
shmop_write($shm1, $write, 0);

$shm2 = shmop_open(0, 'c', 0777, 1024);
$read = shmop_read($shm2, 0, 4);

var_dump(is_string($read) && $read !== $write);

shmop_close($shm1);
shmop_close($shm2);
?>
--EXPECT--
bool(true)