3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.16 ms | 1387 KiB | 23 Q