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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.5 ms | 1401 KiB | 25 Q