3v4l.org

run code in 500+ PHP versions simultaneously
<?php $color_ids = [ 'green' => [1, 2, 3], 'blue' => [4, 5], 'red' => [6], 'pink' => [7, 8, 9], 'yellow' => [10] ]; $select = ['green', 'red', 'yellow']; var_export( array_merge( ...array_values( array_intersect_key( $color_ids, array_flip($select) ) ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WjDff
function name:  (null)
number of ops:  20
compiled vars:  !0 = $color_ids, !1 = $select
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, <array>
   13     2        INIT_FCALL                                                   'var_export'
   14     3        INIT_FCALL                                                   'array_merge'
   15     4        INIT_FCALL                                                   'array_values'
   16     5        INIT_FCALL                                                   'array_intersect_key'
   17     6        SEND_VAR                                                     !0
   18     7        INIT_FCALL                                                   'array_flip'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                             $4      
         10        SEND_VAR                                                     $4
   16    11        DO_ICALL                                             $5      
   18    12        SEND_VAR                                                     $5
   15    13        DO_ICALL                                             $6      
   18    14        SEND_UNPACK                                                  $6
         15        CHECK_UNDEF_ARGS                                             
   14    16        DO_ICALL                                             $7      
   18    17        SEND_VAR                                                     $7
   13    18        DO_ICALL                                                     
   22    19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.16 ms | 2050 KiB | 18 Q