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); print_r( array_merge( array_flip( array('1','5')), $flipped)); $intersection = array_intersect_key( array_merge( $flipped, $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/FU9J5
function name:  (null)
number of ops:  43
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                                               'print_r'
         14        INIT_FCALL                                               'array_merge'
         15        INIT_FCALL                                               'array_flip'
         16        SEND_VAL                                                 <array>
         17        DO_ICALL                                         $11     
         18        SEND_VAR                                                 $11
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $12     
         21        SEND_VAR                                                 $12
         22        DO_ICALL                                                 
   10    23        INIT_FCALL                                               'array_intersect_key'
         24        INIT_FCALL                                               'array_merge'
         25        SEND_VAR                                                 !2
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $14     
         28        SEND_VAR                                                 $14
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $15     
         31        ASSIGN                                                   !3, $15
   11    32        INIT_FCALL                                               'print_r'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                                 
   13    35        INIT_FCALL                                               'array_values'
         36        SEND_VAR                                                 !3
         37        DO_ICALL                                         $18     
         38        ASSIGN                                                   !4, $18
   14    39        INIT_FCALL                                               'print_r'
         40        SEND_VAR                                                 !4
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.04 ms | 1396 KiB | 25 Q