Doc #52635 [Opn->Csd]: shm_put_var resorce destruction
| From: | kalle@php.net | Date: | Wed, 20 Oct 2010 02:09:37 +0000 |
| Subject: | Doc #52635 [Opn->Csd]: shm_put_var resorce destruction | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5259@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52635&edit=1
ID: 52635
Updated by: kalle@php.net
Reported by: michal dot zaloudik at gmail dot com
Summary: shm_put_var resorce destruction
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Linux
PHP Version: 5.3.3
-Assigned To:
+Assigned To: kalle
Block user comment: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2010-10-20 04:09:30] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304523
Log: Fixed bug #52635 (shm_put_var resorce destruction)
------------------------------------------------------------------------
[2010-08-19 02:27:58] felipe@php.net
The doc needs be fixed.
Not all datatypes are supported (as is said in the doc), resource cannot
be used. (As the variable is serialized to be put into shared memory)
------------------------------------------------------------------------
[2010-08-18 15:56:42] michal dot zaloudik at gmail dot com
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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52635&edit=1