3v4l.org

run code in 300+ PHP versions simultaneously
<?php function maximum($list,$current) { if(empty($list)) return $current; $test = array_pop($list); return maximum($list, $current < $test ? $test : $current); } $list = array(2,1,4,2,6,77,2,1,3,44); echo maximum($list, 0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t7GAd
function name:  (null)
number of ops:  7
compiled vars:  !0 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
   12     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 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t7GAd
function name:  maximum
number of ops:  20
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        INIT_FCALL_BY_NAME                                       'maximum'
         10        SEND_VAR_EX                                              !0
         11        IS_SMALLER                                               !1, !2
         12      > JMPZ                                                     ~6, ->15
         13    >   QM_ASSIGN                                        ~7      !2
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~7      !1
         16    >   SEND_VAL_EX                                              ~7
         17        DO_FCALL                                      0  $8      
         18      > RETURN                                                   $8
    8    19*     > RETURN                                                   null

End of function maximum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.95 ms | 1390 KiB | 16 Q