3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['id' => 117, 'name' => 'Networking', 'count' => 16], ['id' => 188, 'name' => 'FTP', 'count' => 23], ['id' => 189, 'name' => 'Internet', 'count' => 48], ]; $min = array_shift($array)['count'] ?? null; $max = $min; foreach ($array as $row) { if ($min > $row['count']) { $min = $row['count']; } if ($max < $row['count']) { $max = $row['count']; } } var_export(['min' => $min, 'max' => $max]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 21
Branch analysis from position: 16
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/T2nWD
function name:  (null)
number of ops:  29
compiled vars:  !0 = $array, !1 = $min, !2 = $max, !3 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_shift'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                         $5      
          4        FETCH_DIM_IS                                     ~6      $5, 'count'
          5        COALESCE                                         ~7      ~6
          6        QM_ASSIGN                                        ~7      null
          7        ASSIGN                                                   !1, ~7
   10     8        ASSIGN                                                   !2, !1
   11     9      > FE_RESET_R                                       $10     !0, ->22
         10    > > FE_FETCH_R                                               $10, !3, ->22
   12    11    >   FETCH_DIM_R                                      ~11     !3, 'count'
         12        IS_SMALLER                                               ~11, !1
         13      > JMPZ                                                     ~12, ->16
   13    14    >   FETCH_DIM_R                                      ~13     !3, 'count'
         15        ASSIGN                                                   !1, ~13
   15    16    >   FETCH_DIM_R                                      ~15     !3, 'count'
         17        IS_SMALLER                                               !2, ~15
         18      > JMPZ                                                     ~16, ->21
   16    19    >   FETCH_DIM_R                                      ~17     !3, 'count'
         20        ASSIGN                                                   !2, ~17
   11    21    > > JMP                                                      ->10
         22    >   FE_FREE                                                  $10
   19    23        INIT_FCALL                                               'var_export'
         24        INIT_ARRAY                                       ~19     !1, 'min'
         25        ADD_ARRAY_ELEMENT                                ~19     !2, 'max'
         26        SEND_VAL                                                 ~19
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
215.4 ms | 1002 KiB | 15 Q