3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { public $var = 1; } $testArray = array( new TestClass(), new TestClass() ); foreach($testArray as $t) { $t->var = 2; } var_dump($testArray[0]->var);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/mPRMI
function name:  (null)
number of ops:  19
compiled vars:  !0 = $testArray, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'TestClass'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~4      $2
   12     3        NEW                                              $5      'TestClass'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~4      $5
   10     6        ASSIGN                                                   !0, ~4
   15     7      > FE_RESET_R                                       $8      !0, ->12
          8    > > FE_FETCH_R                                               $8, !1, ->12
   16     9    >   ASSIGN_OBJ                                               !1, 'var'
         10        OP_DATA                                                  2
   15    11      > JMP                                                      ->8
         12    >   FE_FREE                                                  $8
   19    13        INIT_FCALL                                               'var_dump'
         14        FETCH_DIM_R                                      ~10     !0, 0
         15        FETCH_OBJ_R                                      ~11     ~10, 'var'
         16        SEND_VAL                                                 ~11
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class TestClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.69 ms | 940 KiB | 16 Q