1.2.1592. ext/shmop¶
Extension ext/shmop.
Shmop is an easy to use set of functions that allows PHP to read, write, create and delete Unix shared memory segments.
<?php
// Create a temporary file and return its path
$tmp = tempnam('/tmp', 'PHP');
// Get the file token key
$key = ftok($tmp, 'a');
// Attach the SHM resource, notice the cast afterwards
$id = shm_attach($key);
if ($id === false) {
die('Unable to create the shared memory segment');
}
// Cast to integer, since prior to PHP 5.3.0 the resource id
// is returned which can be exposed when casting a resource
// to an integer
$id = (integer) $id;
?>
See also Semaphore, Shared Memory and IPC.
1.2.1592.1. Specs¶
Short name |
Extensions/Extshmop |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |