3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0 => 'b', 1 => 'b']; foreach ($array as $value) { var_dump('A'); if (last($value)) { var_dump('B'); } } var_dump(sizeof($array));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/mlpKS
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $3      !0, ->14
          2    > > FE_FETCH_R                                               $3, !1, ->14
    6     3    >   INIT_FCALL                                               'var_dump'
          4        SEND_VAL                                                 'A'
          5        DO_ICALL                                                 
    8     6        INIT_FCALL_BY_NAME                                       'last'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $5      
          9      > JMPZ                                                     $5, ->13
    9    10    >   INIT_FCALL                                               'var_dump'
         11        SEND_VAL                                                 'B'
         12        DO_ICALL                                                 
    5    13    > > JMP                                                      ->2
         14    >   FE_FREE                                                  $3
   13    15        INIT_FCALL                                               'var_dump'
         16        COUNT                                            ~7      !0
         17        SEND_VAL                                                 ~7
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.06 ms | 1399 KiB | 15 Q