3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0 => 'a', 1 => 'b']; foreach ($array as $value) { var_dump(end($array)); var_dump($value); 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 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/TSmNT
function name:  (null)
number of ops:  26
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, ->20
          2    > > FE_FETCH_R                                               $3, !1, ->20
    6     3    >   INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'end'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
    8     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   10    12        INIT_FCALL_BY_NAME                                       'last'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $7      
         15      > JMPZ                                                     $7, ->19
   11    16    >   INIT_FCALL                                               'var_dump'
         17        SEND_VAL                                                 'B'
         18        DO_ICALL                                                 
    5    19    > > JMP                                                      ->2
         20    >   FE_FREE                                                  $3
   15    21        INIT_FCALL                                               'var_dump'
         22        COUNT                                            ~9      !0
         23        SEND_VAL                                                 ~9
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.99 ms | 1395 KiB | 17 Q