3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public $bar = null; public function __construct() { $this->bar = new DateTime(); // Now $this->far = &$this->bar; } } $foo= new Foo(); var_dump($foo); $vars = get_object_vars($foo); $vars['bar'] = new DateTime('2014-03-25'); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H7h4N
function name:  (null)
number of ops:  19
compiled vars:  !0 = $foo, !1 = $vars
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $2      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   11     3        INIT_FCALL                                                   'var_dump'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                                     
   12     6        INIT_FCALL                                                   'get_object_vars'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                             $6      
          9        ASSIGN                                                       !1, $6
   13    10        NEW                                                  $9      'DateTime'
         11        SEND_VAL_EX                                                  '2014-03-25'
         12        DO_FCALL                                          0          
         13        ASSIGN_DIM                                                   !1, 'bar'
         14        OP_DATA                                                      $9
   14    15        INIT_FCALL                                                   'var_dump'
         16        SEND_VAR                                                     !0
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H7h4N
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   NEW                                                  $1      'DateTime'
          1        DO_FCALL                                          0          
          2        ASSIGN_OBJ                                                   'bar'
          3        OP_DATA                                                      $1
    7     4        FETCH_OBJ_W                                          $4      'bar'
          5        MAKE_REF                                             $5      $4
          6        ASSIGN_OBJ_REF                                               'far'
          7        OP_DATA                                                      $5
    8     8      > RETURN                                                       null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.3 ms | 3694 KiB | 15 Q