3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "1,5"; $base = array('1'=>'Bread','5'=>'Butter'); $replacements = array_intersect_key( $base, array_flip( explode(',', $str))); print_r( $replacements);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zsi2Z
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $base, !2 = $replacements
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '1%2C5'
    3     1        ASSIGN                                                   !1, <array>
    4     2        INIT_FCALL                                               'array_intersect_key'
          3        SEND_VAR                                                 !1
          4        INIT_FCALL                                               'array_flip'
          5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2C'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
    5    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.51 ms | 1386 KiB | 21 Q