ID: 26177
User updated by: l_faillie at yahoo dot com
Reported By: l_faillie at yahoo dot com
Status: Open
Bug Type: Unknown/Other Function
Operating System: Solaris 8
PHP Version: 4.3.3
New Comment:

Yes it was my workaround but ... if it's the correct beaviour of this
function, what is the usefullness of the second argument ?


Previous Comments:
------------------------------------------------------------------------

[2003-11-08 12:42:22] cunha17 at uol dot com dot br

In fact, you should use an array if you want to store multiple
information.

Source 1 : storing variables

$shm = shm_attach( 2710, 512);
$data = array('val'=>'blabla',
'jour'=> date('D'));
shm_put_var( $shm, 'data', serialize($data));


Source 2 : reading variables

$shm = shm_attach( 2710, 512);
$data = unserialize(shm_get_var($shm, 'data'));
echo 'val :', $data['val'], "\n";
echo 'jour :', $data['jour'], "\n";

------------------------------------------------------------------------

[2003-11-08 10:06:05] l_faillie at yahoo dot com

Description:
------------
Hi all,

It seems only one variable can be stored in a SHM zone.

Reproduce code:
---------------
Source 1 : storing variables

$shm = shm_attach( 2710, 512);

shm_put_var( $shm, 'val', 'blabla');
shm_put_var( $shm, 'jour', date('D'));

Source 2 : reading variables

$shm = shm_attach( 2710, 512);
echo 'val :', shm_get_var($shm, 'val'), "\n";
echo 'jour :', shm_get_var($shm, 'jour'), "\n";

Expected result:
----------------
val :blabla
jour :Sat

Actual result:
--------------
val :Sat
jour :Sat



------------------------------------------------------------------------


--
Edit this bug report at [url]http://bugs.php.net/?id=26177&edit=1[/url]