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"; }
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/91u64
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'A'
          1        SEND_VAL_EX                                              1
          2        SEND_VAL_EX                                              '42'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   14     5      > FE_RESET_R                                       $5      !0, ->12
          6    > > FE_FETCH_R                                               $5, !1, ->12
   15     7    >   ASSIGN_OBJ                                               !0, 'y'
          8        OP_DATA                                                  '500'
   16     9        CONCAT                                           ~7      !1, '%0A'
         10        ECHO                                                     ~7
   14    11      > JMP                                                      ->6
         12    >   FE_FREE                                                  $5
   19    13      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/91u64
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:
161.47 ms | 1394 KiB | 13 Q