3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ObjectWithReferences { protected $var1; protected $var2; public function __construct() { $this->var1 = new StdClass(); $this->var2 = $this->var1; } } class WrapperObject { static $tempstorage; protected $obj; public function setObject($obj) { $this->obj = $obj; } public function getObject() { return $this->obj; } } $owr = new ObjectWithReferences(); $wrapper = new WrapperObject(); $wrapper->setObject($owr); var_dump($wrapper->getObject()); $wrapper = unserialize(serialize($wrapper)); var_dump($wrapper->getObject());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MoGJ0
function name:  (null)
number of ops:  27
compiled vars:  !0 = $owr, !1 = $wrapper
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $2      'ObjectWithReferences'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   31     3        NEW                                              $5      'WrapperObject'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   33     6        INIT_METHOD_CALL                                         !1, 'setObject'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   34     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !1, 'getObject'
         11        DO_FCALL                                      0  $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                                 
   36    14        INIT_FCALL                                               'unserialize'
         15        INIT_FCALL                                               'serialize'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !1, $12
   38    21        INIT_FCALL                                               'var_dump'
         22        INIT_METHOD_CALL                                         !1, 'getObject'
         23        DO_FCALL                                      0  $14     
         24        SEND_VAR                                                 $14
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Class ObjectWithReferences:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MoGJ0
function name:  __construct
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'var1'
          3        OP_DATA                                                  $1
    9     4        FETCH_OBJ_R                                      ~4      'var1'
          5        ASSIGN_OBJ                                               'var2'
          6        OP_DATA                                                  ~4
   10     7      > RETURN                                                   null

End of function __construct

End of class ObjectWithReferences.

Class WrapperObject:
Function setobject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MoGJ0
function name:  setObject
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ASSIGN_OBJ                                               'obj'
          2        OP_DATA                                                  !0
   22     3      > RETURN                                                   null

End of function setobject

Function getobject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MoGJ0
function name:  getObject
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'obj'
          1      > RETURN                                                   ~0
   26     2*     > RETURN                                                   null

End of function getobject

End of class WrapperObject.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.62 ms | 1400 KiB | 19 Q