From:             
Operating system: *nix
PHP version:      5.3.5
Package:          Semaphore related
Bug Type:         Bug
Bug description:shm_put_var and SplStack

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 bug report at http://bugs.php.net/bug.php?id=53835&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53835&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53835&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53835&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53835&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53835&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53835&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53835&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53835&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53835&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53835&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53835&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53835&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53835&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53835&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53835&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53835&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53835&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53835&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53835&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53835&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53835&r=mysqlcfg

Reply via email to