3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = array(5,-21,59,8,12,-1); function array_max($array) { $max = $array[0]; for ($i = 0; $i < count($array); $i++) { if ($array[$i] > $max) { $max = $array[$i]; } } echo $max; } array_max($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PQFBH
function name:  (null)
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'array_max'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function array_max:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 5
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 5
Branch analysis from position: 14
Branch analysis from position: 5
Branch analysis from position: 10
filename:       /in/PQFBH
function name:  array_max
number of ops:  16
compiled vars:  !0 = $array, !1 = $max, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        FETCH_DIM_R                                      ~3      !0, 0
          2        ASSIGN                                                   !1, ~3
    6     3        ASSIGN                                                   !2, 0
          4      > JMP                                                      ->11
    7     5    >   FETCH_DIM_R                                      ~6      !0, !2
          6        IS_SMALLER                                               !1, ~6
          7      > JMPZ                                                     ~7, ->10
    8     8    >   FETCH_DIM_R                                      ~8      !0, !2
          9        ASSIGN                                                   !1, ~8
    6    10    >   PRE_INC                                                  !2
         11    >   COUNT                                            ~11     !0
         12        IS_SMALLER                                               !2, ~11
         13      > JMPNZ                                                    ~12, ->5
   11    14    >   ECHO                                                     !1
   12    15      > RETURN                                                   null

End of function array_max

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.15 ms | 1398 KiB | 14 Q