3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ids = [ [1,2,3,4], [2,3,4], [3,4,5], ]; $res = array_splice($ids,0,1)[0]; foreach($ids as $id){ $res = array_intersect($res, $id); } var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/Z7uZK
function name:  (null)
number of ops:  21
compiled vars:  !0 = $ids, !1 = $res, !2 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_splice'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $4      
          6        FETCH_DIM_R                                      ~5      $4, 0
          7        ASSIGN                                                   !1, ~5
   11     8      > FE_RESET_R                                       $7      !0, ->16
          9    > > FE_FETCH_R                                               $7, !2, ->16
   12    10    >   INIT_FCALL                                               'array_intersect'
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !1, $8
   11    15      > JMP                                                      ->9
         16    >   FE_FREE                                                  $7
   15    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.77 ms | 1007 KiB | 16 Q