3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $x; public $y; public function __construct($x, $y) { $this->x = $x; $this->y = $y; } } $a = new A(1, "42"); foreach ($a as $v) { $a->y = "500"; print $v . "\n"; } $b = array(1, 2, 3); foreach($b as $v) { $b[1] = 500; print $v . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 12
filename:       /in/NEPim
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $v, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $3      'A'
          1        SEND_VAL_EX                                              1
          2        SEND_VAL_EX                                              '42'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   14     5      > FE_RESET_R                                       $6      !0, ->12
          6    > > FE_FETCH_R                                               $6, !1, ->12
   15     7    >   ASSIGN_OBJ                                               !0, 'y'
          8        OP_DATA                                                  '500'
   16     9        CONCAT                                           ~8      !1, '%0A'
         10        ECHO                                                     ~8
   14    11      > JMP                                                      ->6
         12    >   FE_FREE                                                  $6
   19    13        ASSIGN                                                   !2, <array>
   20    14      > FE_RESET_R                                       $10     !2, ->21
         15    > > FE_FETCH_R                                               $10, !1, ->21
   21    16    >   ASSIGN_DIM                                               !2, 1
         17        OP_DATA                                                  500
   22    18        CONCAT                                           ~12     !1, '%0A'
         19        ECHO                                                     ~12
   20    20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $10
   25    22      > RETURN                                                   1

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

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.48 ms | 1395 KiB | 13 Q