3v4l.org

run code in 300+ 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 = 47
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 47
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
2 jumps found. (Code = 47) Position 1 = 28, Position 2 = 43
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 39
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 46
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
Branch analysis from position: 46
Branch analysis from position: 43
Branch analysis from position: 25
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
Branch analysis from position: 25
Branch analysis from position: 22
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/pnMvU
function name:  getMinMax
number of ops:  52
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, ->47
          3    > > FE_FETCH_R                                               $4, !2, ->47
   16     4    >   FETCH_DIM_R                                      ~5      !1, 'min'
          5        BOOL_NOT                                         ~6      ~5
          6      > JMPNZ_EX                                         ~6      ~6, ->22
   17     7    >   INIT_FCALL                                               'trim'
          8        SEND_VAR                                                 !2
          9        FETCH_DIM_R                                      ~7      !1, 'min'
         10        SEND_VAL                                                 ~7
         11        DO_ICALL                                         $8      
         12        BOOL_NOT                                         ~9      $8
         13      > JMPZ                                                     ~9, ->18
         14    >   FETCH_DIM_R                                      ~10     !1, 'min'
         15        IS_SMALLER                                       ~11     !2, ~10
         16        QM_ASSIGN                                        ~12     ~11
         17      > JMP                                                      ->21
         18    >   FETCH_DIM_R                                      ~13     !1, 'min'
         19        IS_SMALLER                                       ~14     ~13, !2
         20        QM_ASSIGN                                        ~12     ~14
         21    >   BOOL                                             ~6      ~12
         22    > > JMPZ                                                     ~6, ->25
   19    23    >   ASSIGN_DIM                                               !1, 'min'
         24        OP_DATA                                                  !2
   22    25    >   FETCH_DIM_R                                      ~16     !1, 'max'
         26        BOOL_NOT                                         ~17     ~16
         27      > JMPNZ_EX                                         ~17     ~17, ->43
   23    28    >   INIT_FCALL                                               'trim'
         29        SEND_VAR                                                 !2
         30        FETCH_DIM_R                                      ~18     !1, 'max'
         31        SEND_VAL                                                 ~18
         32        DO_ICALL                                         $19     
         33        BOOL_NOT                                         ~20     $19
         34      > JMPZ                                                     ~20, ->39
         35    >   FETCH_DIM_R                                      ~21     !1, 'max'
         36        IS_SMALLER                                       ~22     ~21, !2
         37        QM_ASSIGN                                        ~23     ~22
         38      > JMP                                                      ->42
         39    >   FETCH_DIM_R                                      ~24     !1, 'max'
         40        IS_SMALLER                                       ~25     !2, ~24
         41        QM_ASSIGN                                        ~23     ~25
         42    >   BOOL                                             ~17     ~23
         43    > > JMPZ                                                     ~17, ->46
   25    44    >   ASSIGN_DIM                                               !1, 'max'
         45        OP_DATA                                                  !2
   14    46    > > JMP                                                      ->3
         47    >   FE_FREE                                                  $4
   28    48        VERIFY_RETURN_TYPE                                       !1
         49      > RETURN                                                   !1
   29    50*       VERIFY_RETURN_TYPE                                       
         51*     > RETURN                                                   null

End of function getminmax

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.82 ms | 1403 KiB | 18 Q