xref: /PHP-8.3/ext/shmop/tests/gh14537.phpt (revision 39a32665)
1--TEST--
2GH-14537: shmop Windows 11 crashes the process
3--EXTENSIONS--
4shmop
5--SKIPIF--
6<?php
7if (PHP_OS_FAMILY !== 'Windows') die('skip only for Windows');
8?>
9--FILE--
10<?php
11$str = 'Hello World';
12
13$shm_key = ftok(__FILE__, 'p');
14
15$shm_id1 = shmop_open($shm_key, 'c', 0644, strlen($str));
16shmop_delete($shm_id1);
17var_dump($shm_id1);
18
19$shm_id2 = shmop_open($shm_key, 'c', 0644, strlen($str) + 10);
20var_dump($shm_id2);
21?>
22--EXPECTF--
23object(Shmop)#1 (0) {
24}
25
26Warning: shmop_open(): Unable to attach or create shared memory segment "No error" in %s on line %d
27bool(false)
28