Edit report at http://bugs.php.net/bug.php?id=53835&edit=1
ID: 53835
User updated by: minisotm at gmail dot com
Reported by: minisotm at gmail dot com
Summary: shm_put_var and SplStack
Status: Open
Type: Bug
Package: Semaphore related
Operating System: *nix
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
An object SplDoublyLinkedList () the same situation.
Previous Comments:
------------------------------------------------------------------------
[2011-01-25 08:32:53] minisotm at gmail dot com
Description:
------------
When trying to write an object through the function shm_put_var SplStack
it is
empty when invoking a shm_get_var.
Test script:
---------------
<?php
$SHM_KEY = ftok(__FILE__, chr( 4 ) );
$data = shm_attach($SHM_KEY, 102400, 0666);
$testData = array("hello","world","1","2","3");
$test = new SplStack();
$test->push($testData);
print_r($test);
shm_put_var($data, 1, $test);
print_r(shm_get_var($data, 1));
shm_detach($data);
Expected result:
----------------
one:
SplStack Object
(
[flags:SplDoublyLinkedList:private] => 6
[dllist:SplDoublyLinkedList:private] => Array
(
[0] => Array
(
[0] => hello
[1] => world
[2] => 1
[3] => 2
[4] => 3
)
)
)
two:
SplStack Object
(
[flags:SplDoublyLinkedList:private] => 6
[dllist:SplDoublyLinkedList:private] => Array
(
[0] => Array
(
[0] => hello
[1] => world
[2] => 1
[3] => 2
[4] => 3
)
)
)
Actual result:
--------------
one:
SplStack Object
(
[flags:SplDoublyLinkedList:private] => 6
[dllist:SplDoublyLinkedList:private] => Array
(
[0] => Array
(
[0] => hello
[1] => world
[2] => 1
[3] => 2
[4] => 3
)
)
)
two:
SplStack Object
(
[flags:SplDoublyLinkedList:private] => 6
[dllist:SplDoublyLinkedList:private] => Array
(
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53835&edit=1