summaryrefslogtreecommitdiff
path: root/ext/shmop/tests/shmop_open_private.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/shmop/tests/shmop_open_private.phpt')
-rw-r--r--ext/shmop/tests/shmop_open_private.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/shmop/tests/shmop_open_private.phpt b/ext/shmop/tests/shmop_open_private.phpt
new file mode 100644
index 0000000000..df969885c9
--- /dev/null
+++ b/ext/shmop/tests/shmop_open_private.phpt
@@ -0,0 +1,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)