3v4l.org

run code in 300+ PHP versions simultaneously
<?php function maximum($list,$current) { if(empty($list)) return $current; $test = array_pop($list); $current = $current < $test ? $test : $current; $current = maximum($list, $current); return $current; } $list = array(2,1,4,2,6,7,2,1,3,4); echo maximum($list, 0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BjZph
function name:  (null)
number of ops:  7
compiled vars:  !0 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'maximum'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function maximum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BjZph
function name:  maximum
number of ops:  22
compiled vars:  !0 = $list, !1 = $current, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ISSET_ISEMPTY_CV                                         !0
          3      > JMPZ                                                     ~3, ->5
          4    > > RETURN                                                   !1
    6     5    >   INIT_FCALL                                               'array_pop'
          6        SEND_REF                                                 !0
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !2, $4
    7     9        IS_SMALLER                                               !1, !2
         10      > JMPZ                                                     ~6, ->13
         11    >   QM_ASSIGN                                        ~7      !2
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~7      !1
         14    >   ASSIGN                                                   !1, ~7
    8    15        INIT_FCALL_BY_NAME                                       'maximum'
         16        SEND_VAR_EX                                              !0
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0  $9      
         19        ASSIGN                                                   !1, $9
    9    20      > RETURN                                                   !1
   10    21*     > RETURN                                                   null

End of function maximum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.34 ms | 1399 KiB | 16 Q