3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $test = 0; public function __construct($x){ $this->test = $x; } } $array = array( new Test(1), new Test(2), new Test(3), new Test(4), ); foreach($array as $key=> $item){ $item->test +=10; } var_dump($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/VC1Qr
function name:  (null)
number of ops:  28
compiled vars:  !0 = $array, !1 = $item, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $3      'Test'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~5      $3
   11     4        NEW                                              $6      'Test'
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0          
          7        ADD_ARRAY_ELEMENT                                ~5      $6
   12     8        NEW                                              $8      'Test'
          9        SEND_VAL_EX                                              3
         10        DO_FCALL                                      0          
         11        ADD_ARRAY_ELEMENT                                ~5      $8
   13    12        NEW                                              $10     'Test'
         13        SEND_VAL_EX                                              4
         14        DO_FCALL                                      0          
         15        ADD_ARRAY_ELEMENT                                ~5      $10
    9    16        ASSIGN                                                   !0, ~5
   16    17      > FE_RESET_R                                       $13     !0, ->23
         18    > > FE_FETCH_R                                       ~14     $13, !1, ->23
         19    >   ASSIGN                                                   !2, ~14
   17    20        ASSIGN_OBJ_OP                                 1          !1, 'test'
         21        OP_DATA                                                  10
   16    22      > JMP                                                      ->18
         23    >   FE_FREE                                                  $13
   19    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VC1Qr
function name:  __construct
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               'test'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.91 ms | 1396 KiB | 15 Q