|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #48529 Better shm_-functions
Submitted: 2009-06-11 12:24 UTC Modified: 2018-06-18 23:51 UTC
From: ilovekernelpanic at yahoo dot de Assigned:
Status: Not a bug Package: Semaphore related
PHP Version: 5.2.9 OS: Unix
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ilovekernelpanic at yahoo dot de
New email:
PHP Version: OS:


 [2009-06-11 12:24 UTC] ilovekernelpanic at yahoo dot de
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
Maybe also shm_resize could be possible.

With this function there could be better object oriented array like
wrappers form shared memory.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-23 21:10 UTC]
-Package: Feature/Change Request +Package: Semaphore related
 [2018-06-18 23:51 UTC]
-Status: Open +Status: Not a bug
 [2018-06-18 23:51 UTC]
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

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. exists since 5.3.0
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 01:03:34 2021 UTC