3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayOne = [ '/Not/in//there', '/Intermediary/contract//bank-accounts', '/Manager/action//bank-bills']; $arrayTwo = [ '/Not/in/the/other//array', '/Intermediary/contract/{contract:id}/bank-accounts', '/Manager/action/{action:id}/bank-bills', '/Not/in/{aaa:bbb]/array']; $result = array_intersect_key( $arrayTwo, array_intersect(preg_replace('/\{[^}]+\}/', '', $arrayTwo), $arrayOne) ); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gl00j
function name:  (null)
number of ops:  20
compiled vars:  !0 = $arrayOne, !1 = $arrayTwo, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   14     2        INIT_FCALL                                               'array_intersect_key'
   15     3        SEND_VAR                                                 !1
   16     4        INIT_FCALL                                               'array_intersect'
          5        INIT_FCALL                                               'preg_replace'
          6        SEND_VAL                                                 '%2F%5C%7B%5B%5E%7D%5D%2B%5C%7D%2F'
          7        SEND_VAL                                                 ''
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
   14    14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !2, $7
   19    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.62 ms | 1008 KiB | 17 Q