|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-19 02:27 UTC] felipe@php.net
-Type: Bug
+Type: Documentation Problem
-Package: Semaphore related
+Package: Documentation problem
[2010-08-19 02:27 UTC] felipe@php.net
[2010-10-20 04:09 UTC] kalle@php.net
[2010-10-20 04:09 UTC] kalle@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: kalle
[2010-10-20 04:09 UTC] kalle@php.net
[2020-02-07 06:09 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 07:00:01 2025 UTC |
Description: ------------ I'm putting socket resource or any other resource into shared memory using shm_put_var and when im using shm_get_var i'm getting (int)0. Test script: --------------- Based on script finded on doc site. <?php define("FOPEN_RESOURCE", 1); define("FOPEN_FILEPATH", __FILE__); $fopen_resource = fopen(FOPEN_FILEPATH, "r"); var_dump($fopen_resource); $shm_id = shm_attach(1); if ($shm_id === false) { echo "Fail to attach shared memory.\n"; } if (!shm_put_var($shm_id, FOPEN_RESOURCE, $fopen_resource)) { echo "Failed to put var 1 in shared memory $shm_id.\n"; } $sm_fopen_resource = shm_get_var($shm_id, FOPEN_RESOURCE); if ($sm_fopen_resource === false) { echo "Failed to retreive fopen_resource from Shared memory\r\n"; } var_dump($sm_fopen_resource); if($shm_id) shm_remove($shm_id); if($fopen_resource) fclose($fopen_resource); ?> Expected result: ---------------- resource(5) of type (stream) resource(5) of type (stream) Actual result: -------------- resource(5) of type (stream) int(0)