3v4l.org

run code in 300+ PHP versions simultaneously
<?php $priority = [ "a" => "AAA", "b" => "AA", "c" => "A", "d" => "BBB", "e" => "BB", "f" => "B", "g" => "CCC", "h" => "CC", "i" => "C" ]; $ratingHistory = [ "BB", "B", "CCC", "C", "BB" ]; $ratingHistory = array_intersect($priority, $ratingHistory); var_export([ 'min' => $ratingHistory[key($ratingHistory)], 'max' => $ratingHistory[array_key_last($ratingHistory)] ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PbfHl
function name:  (null)
number of ops:  21
compiled vars:  !0 = $priority, !1 = $ratingHistory
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <array>
   22     2        INIT_FCALL                                               'array_intersect'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
   23     7        INIT_FCALL                                               'var_export'
   24     8        INIT_FCALL                                               'key'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        FETCH_DIM_R                                      ~7      !1, $6
         12        INIT_ARRAY                                       ~8      ~7, 'min'
   25    13        INIT_FCALL                                               'array_key_last'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $9      
         16        FETCH_DIM_R                                      ~10     !1, $9
         17        ADD_ARRAY_ELEMENT                                ~8      ~10, 'max'
         18        SEND_VAL                                                 ~8
         19        DO_ICALL                                                 
   26    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.73 ms | 1399 KiB | 21 Q