3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('foo', 'bar'); $result = NULL; foreach ($arr as $key => $val) $result = $val; var_dump($result); var_dump(end($arr));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/mvbak
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr, !1 = $result, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, null
    4     2      > FE_RESET_R                                       $6      !0, ->7
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->7
          4    >   ASSIGN                                                   !3, ~7
    5     5        ASSIGN                                                   !1, !2
    4     6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $6
    6     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
    7    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'end'
         13        SEND_REF                                                 !0
         14        DO_ICALL                                         $11     
         15        SEND_VAR                                                 $11
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.75 ms | 1395 KiB | 17 Q