3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Testing { public $arr = array(); public function test() { $ob = new StdClass(); $ob->name = 'derp'; $this->arr[] = $ob; return $ob; } } $t = new Testing(); $derp = $t->test(); $derp->name = 'test'; echo $t->arr[0]->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7PbGe
function name:  (null)
number of ops:  13
compiled vars:  !0 = $t, !1 = $derp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Testing'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   18     6        ASSIGN_OBJ                                               !1, 'name'
          7        OP_DATA                                                  'test'
   20     8        FETCH_OBJ_R                                      ~8      !0, 'arr'
          9        FETCH_DIM_R                                      ~9      ~8, 0
         10        FETCH_OBJ_R                                      ~10     ~9, 'name'
         11        ECHO                                                     ~10
         12      > RETURN                                                   1

Class Testing:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7PbGe
function name:  test
number of ops:  10
compiled vars:  !0 = $ob
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  'derp'
   10     5        FETCH_OBJ_W                                      $5      'arr'
          6        ASSIGN_DIM                                               $5
          7        OP_DATA                                                  !0
   11     8      > RETURN                                                   !0
   12     9*     > RETURN                                                   null

End of function test

End of class Testing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.62 ms | 1385 KiB | 13 Q