3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original_ids = array(1, 2, 3, 4); //<--- Original values without sorted. $sorted_ids = array(4, 1, 3); //<--- Fixed values (sort by this) $result_ids = array(); //<--- The result array after sorted $result_ids = array_intersect($original_ids, $sorted_ids); var_dump($result_ids);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nZK4v
function name:  (null)
number of ops:  12
compiled vars:  !0 = $original_ids, !1 = $sorted_ids, !2 = $result_ids
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    6     3        INIT_FCALL                                               'array_intersect'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
    8     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.83 ms | 1385 KiB | 17 Q