From:             
Operating system: Windows 7 and AmigaOS v3.1
PHP version:      Irrelevant
Package:          Testing related
Bug Type:         Bug
Bug description:Discrepency with var_dump

Description:
------------
Hello,

I compiled PHP 4.2.3 for m68k-amigaos and the test case tests/lang/029.php
fails. I tracked what could be a related bug:
https://bugs.php.net/bug.php?id=7515. Could someone tell me more about what
has been changed into the Zend engine to fix this earlier bug so that I can
track this change and the bug? Or could someone explain me the meaning of
the "&" in that particular case.

Code to execute:
    class obj {
            function method() {
            }
    }
    $o->root=new obj();
    var_dump($o);

    $o->root->method();
    var_dump($o);

and its output with PHP 4.2.3 compiled for m68k-amigaos:
    object(stdClass)(1) {
      ["root"]=>
      object(obj)(0) {
      }
    }
    object(stdClass)(1) {
      ["root"]=>
      &object(obj)(0) {
      }
    }

(note the ampersand in the second dump), while, with PHP 5.2.14 on Windows
7, the output is:
    object(stdClass)#2 (1) {
      ["root"]=>
      object(obj)#1 (0) {
      }
    }
    object(stdClass)#2 (1) {
      ["root"]=>
      object(obj)#1 (0) {
      }
    }

Does it make sense that in the second statement "$o->root->method();", the
method is viewed as a reference to an object?

Please forgive me if my question is silly, I am a newbie in OO PHP.

Thanks,
Tygre

Test script:
---------------
    class obj {
            function method() {
            }
    }
    $o->root=new obj();
    var_dump($o);

    $o->root->method();
    var_dump($o);


Expected result:
----------------
    object(stdClass)#2 (1) {
      ["root"]=>
      object(obj)#1 (0) {
      }
    }
    object(stdClass)#2 (1) {
      ["root"]=>
      object(obj)#1 (0) {
      }
    }


Actual result:
--------------
    object(stdClass)(1) {
      ["root"]=>
      object(obj)(0) {
      }
    }
    object(stdClass)(1) {
      ["root"]=>
      &object(obj)(0) {
      }
    }


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

Reply via email to