3v4l.org

run code in 500+ PHP versions simultaneously
<?php $ratingHistory = [ "BB", "B", "CCC", "C", "BB" ]; function getMinMax($array): array { $result = ['min' => null, 'max' => null]; foreach ($array as $value) { if ( !$result['min'] || (!trim($value, $result['min']) ? $value < $result['min'] : $value > $result['min']) ) { $result['min'] = $value; } if ( !$result['max'] || (!trim($value, $result['max']) ? $value > $result['max'] : $value < $result['max']) ) { $result['max'] = $value; } } return $result; } var_export(getMinMax($ratingHistory));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pnMvU
function name:  (null)
number of ops:  8
compiled vars:  !0 = $ratingHistory
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   30     1        INIT_FCALL                                                   'var_export'
          2        INIT_FCALL                                                   'getminmax'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $2      
          5        SEND_VAR                                                     $2
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Function getminmax:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 41
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 41
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 37
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 33
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 40
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
Branch analysis from position: 40
Branch analysis from position: 37
Branch analysis from position: 22
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
Branch analysis from position: 22
Branch analysis from position: 19
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/pnMvU
function name:  getMinMax
number of ops:  46
compiled vars:  !0 = $array, !1 = $result, !2 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
   13     1        ASSIGN                                                       !1, <array>
   14     2      > FE_RESET_R                                           $4      !0, ->41
          3    > > FE_FETCH_R                                                   $4, !2, ->41
   16     4    >   FETCH_DIM_R                                          ~5      !1, 'min'
          5        BOOL_NOT                                             ~6      ~5
          6      > JMPNZ_EX                                             ~6      ~6, ->19
   17     7    >   FETCH_DIM_R                                          ~7      !1, 'min'
          8        FRAMELESS_ICALL_2                trim                ~8      !2, ~7
          9        BOOL_NOT                                             ~9      ~8
         10      > JMPZ                                                         ~9, ->15
         11    >   FETCH_DIM_R                                          ~10     !1, 'min'
         12        IS_SMALLER                                           ~11     !2, ~10
         13        QM_ASSIGN                                            ~12     ~11
         14      > JMP                                                          ->18
         15    >   FETCH_DIM_R                                          ~13     !1, 'min'
         16        IS_SMALLER                                           ~14     ~13, !2
         17        QM_ASSIGN                                            ~12     ~14
         18    >   BOOL                                                 ~6      ~12
         19    > > JMPZ                                                         ~6, ->22
   19    20    >   ASSIGN_DIM                                                   !1, 'min'
         21        OP_DATA                                                      !2
   22    22    >   FETCH_DIM_R                                          ~16     !1, 'max'
         23        BOOL_NOT                                             ~17     ~16
         24      > JMPNZ_EX                                             ~17     ~17, ->37
   23    25    >   FETCH_DIM_R                                          ~18     !1, 'max'
         26        FRAMELESS_ICALL_2                trim                ~19     !2, ~18
         27        BOOL_NOT                                             ~20     ~19
         28      > JMPZ                                                         ~20, ->33
         29    >   FETCH_DIM_R                                          ~21     !1, 'max'
         30        IS_SMALLER                                           ~22     ~21, !2
         31        QM_ASSIGN                                            ~23     ~22
         32      > JMP                                                          ->36
         33    >   FETCH_DIM_R                                          ~24     !1, 'max'
         34        IS_SMALLER                                           ~25     !2, ~24
         35        QM_ASSIGN                                            ~23     ~25
         36    >   BOOL                                                 ~17     ~23
         37    > > JMPZ                                                         ~17, ->40
   25    38    >   ASSIGN_DIM                                                   !1, 'max'
         39        OP_DATA                                                      !2
   14    40    > > JMP                                                          ->3
         41    >   FE_FREE                                                      $4
   28    42        VERIFY_RETURN_TYPE                                           !1
         43      > RETURN                                                       !1
   29    44*       VERIFY_RETURN_TYPE                                           
         45*     > RETURN                                                       null

End of function getminmax

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.52 ms | 1867 KiB | 15 Q