Req #48529 [Opn->Nab]: Better shm_-functions
| From: | stas@php.net | Date: | Mon, 18 Jun 2018 23:51:53 +0000 |
| Subject: | Req #48529 [Opn->Nab]: Better shm_-functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215783@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=48529&edit=1
ID: 48529
Updated by: stas@php.net
Reported by: ilovekernelpanic at yahoo dot de
Summary: Better shm_-functions
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: Semaphore related
Operating System: Unix
PHP Version: 5.2.9
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
https://secure.php.net/manual/en/function.shm-has-var.php
exists since 5.3.0
Previous Comments:
------------------------------------------------------------------------
[2009-06-11 12:24:58] ilovekernelpanic at yahoo dot de
Description:
------------
shm provides more speed than files or databases. But there is no
proper way to check if a field exists. You can do
@shm_get_var($connection, $field) !== false to check it. But:
-With custom error handlers you will get a warning, when there is no
such $field
-It needs a lot of time to process the warning, but it should be fast
There should be a function shm_has_var or shm_var_exists.
A function shm_export_vars could convert the shared memory to an
associative array.
A function shm_export_keys: Like
array_keys(shm_export_vars($connection)) but faster
Those functions are very essential. When you don't have them you have
to use the shared-memory as a linked list.
A function shm_get_size: Return the size of the shared memory
segment. Not necessary, because you can store it using
shm_put_var($connection, 0, $size), but such a function would be more
secure
Maybe also shm_resize could be possible.
With this function there could be better object oriented array like
wrappers form shared memory.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=48529&edit=1