3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr =[ [ "controller" => "RegisterController", "method" => "GET", "url" => "/register", "action" => "index" ], [ "controller" => "RegisterController1", "method" => "GET", "url" => "/register", "action" => "index" ], [ "controller" => "RegisterController", "method" => "GET", "url" => "/help", "action" => "index" ]]; $register = array_intersect_key($arr, array_intersect(array_column($arr, "url"), ["/register"])); Var_dump($register);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pIQbZ
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr, !1 = $register
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   22     1        INIT_FCALL                                               'array_intersect_key'
          2        SEND_VAR                                                 !0
          3        INIT_FCALL                                               'array_intersect'
          4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'url'
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        SEND_VAL                                                 <array>
         10        DO_ICALL                                         $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                         $5      
         13        ASSIGN                                                   !1, $5
   23    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.77 ms | 1004 KiB | 17 Q