3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrNotSorted = array( array("sort" => "7", "name" => "Test"), array("sort" => "1", "name" => "Test 2"), array("sort" => "3", "name" => "Test 3"), array("sort" => "5", "name" => "Test 4"), array("sort" => "7", "name" => "Test 4")); $arrSorted = array(5,3,7,1); $arrSortedResult = array_intersect_key( array_values($arrSorted), array_keys($arrNotSorted) ); print_r($arrSortedResult);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oBX3
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arrNotSorted, !1 = $arrSorted, !2 = $arrSortedResult
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'array_intersect_key'
          3        INIT_FCALL                                               'array_values'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        INIT_FCALL                                               'array_keys'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
   13    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.68 ms | 1399 KiB | 21 Q