3v4l.org

run code in 300+ PHP versions simultaneously
<?php $years = [7,8,9]; $students = [ 20=>7, 21=>11, 420=>8, 52=>12, 55=>9 ]; $students = array_filter($students, function($year) use ($years) { return in_array($year, $years); }); print_r($students);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4QCUm
function name:  (null)
number of ops:  13
compiled vars:  !0 = $years, !1 = $students
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
   13     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !1
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4QCUm%3A13%240'
          5        BIND_LEXICAL                                             ~4, !0
   15     6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
   13     8        ASSIGN                                                   !1, $5
   17     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4QCUm%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4QCUm
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $year, !1 = $years
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   14     2        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   15     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4QCUm%3A13%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.36 ms | 1395 KiB | 19 Q