3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new ArrayObject(); $a['b'] = 10; $a[1] = 22; foreach ($a as $b) { print_r($b . PHP_EOL); } iterator_apply($a, fn ($x) => print_r($x . PHP_EOL));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/sf0Hb
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'ArrayObject'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        ASSIGN_DIM                                               !0, 'b'
          4        OP_DATA                                                  10
    5     5        ASSIGN_DIM                                               !0, 1
          6        OP_DATA                                                  22
    6     7      > FE_RESET_R                                       $7      !0, ->14
          8    > > FE_FETCH_R                                               $7, !1, ->14
    7     9    >   INIT_FCALL                                               'print_r'
         10        CONCAT                                           ~8      !1, '%0A'
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                                 
    6    13      > JMP                                                      ->8
         14    >   FE_FREE                                                  $7
    9    15        INIT_FCALL                                               'iterator_apply'
         16        SEND_VAR                                                 !0
         17        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                                 
         20      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sf0Hb
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'print_r'
          2        CONCAT                                           ~1      !0, '%0A'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
          6*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
203.62 ms | 1007 KiB | 15 Q