die('skip not for Windows');
}
if (!extension_loaded("shmop")) {
-
die("skip shmop() extension not available");
}
?>
--FILE--
<?php
$hex_shm_id = function(){
- return rand(0, 9999);
+ return mt_rand(1338, 9999);
};
echo PHP_EOL, '## shmop_open function tests ##';
// warning outputs: start is out of range
$shm_id = shmop_open($hex_shm_id(), 'n', 0600, 1024);
var_dump(shmop_read($shm_id, -10, 0));
+ shmop_delete($shm_id);
// warning outputs: count is out of range
$shm_id = shmop_open($hex_shm_id(), 'n', 0600, 1024);
var_dump(shmop_read($shm_id, 0, -10));
+ shmop_delete($shm_id);
echo PHP_EOL, '## shmop_write function tests ##';
// warning outputs: 3 parameters expected
// warning outputs: offset out of range
$shm_id = shmop_open($hex_shm_id(), 'n', 0600, 1024);
var_dump(shmop_write($shm_id, 'text to try write', -10));
+ shmop_delete($shm_id);
echo PHP_EOL, '## shmop_size function tests ##';
// warning outputs: 1 parameter expected