3v4l.org

run code in 500+ PHP versions simultaneously
<?php class z { public readonly int $p; public readonly int $q; public function __construct() { $this->p = 1; } } $x = new z; // foreach skips undefined properties, readonly or not foreach($x as $k => $v) { print $k . " " . $v . PHP_EOL; } echo $x->q; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/cAniT
function name:  (null)
number of ops:  15
compiled vars:  !0 = $x, !1 = $v, !2 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   NEW                                                  $3      'z'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
   16     3      > FE_RESET_R                                           $6      !0, ->11
          4    > > FE_FETCH_R                                           ~7      $6, !1, ->11
          5    >   ASSIGN                                                       !2, ~7
   17     6        CONCAT                                               ~9      !2, '+'
          7        CONCAT                                               ~10     ~9, !1
          8        CONCAT                                               ~11     ~10, '%0A'
          9        ECHO                                                         ~11
   16    10      > JMP                                                          ->4
         11    >   FE_FREE                                                      $6
   20    12        FETCH_OBJ_R                                          ~12     !0, 'q'
         13        ECHO                                                         ~12
   21    14      > RETURN                                                       1

Class z:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cAniT
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                                   'p'
          1        OP_DATA                                                      1
   10     2      > RETURN                                                       null

End of function __construct

End of class z.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
199.22 ms | 1480 KiB | 13 Q