3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array('pear', 'apple'), array('banana', 'coconut'), 'orange' // This is not an array element ); foreach ($array as $value) { if (is_array($value)) { foreach ($value as $fruit) { echo $fruit . PHP_EOL; } } else { echo $value . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/rMhPL
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $value, !2 = $fruit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1      > FE_RESET_R                                       $4      !0, ->15
          2    > > FE_FETCH_R                                               $4, !1, ->15
   12     3    >   TYPE_CHECK                                  128          !1
          4      > JMPZ                                                     ~5, ->12
   14     5    > > FE_RESET_R                                       $6      !1, ->10
          6    > > FE_FETCH_R                                               $6, !2, ->10
   15     7    >   CONCAT                                           ~7      !2, '%0A'
          8        ECHO                                                     ~7
   14     9      > JMP                                                      ->6
         10    >   FE_FREE                                                  $6
         11      > JMP                                                      ->14
   18    12    >   CONCAT                                           ~8      !1, '%0A'
         13        ECHO                                                     ~8
   10    14    > > JMP                                                      ->2
         15    >   FE_FREE                                                  $4
   20    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.47 ms | 1394 KiB | 13 Q