3v4l.org

run code in 300+ PHP versions simultaneously
<?php $categories = array('Movie'); $reviews = array( array('category' => 'Movie'), array('category' => 'Movie'), array('category' => 'Movie'), array('category' => 'Movie'), array('category' => 'Game') ); print_r($reviews); $filtered = array_filter($reviews, function($review) { return in_array($review['category'], $categories); }); print_r($filtered);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WDnCP
function name:  (null)
number of ops:  15
compiled vars:  !0 = $categories, !1 = $reviews, !2 = $filtered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
   13     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
   15     5        INIT_FCALL                                               'array_filter'
          6        SEND_VAR                                                 !1
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FWDnCP%3A15%240'
   17     8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
   15    10        ASSIGN                                                   !2, $7
   19    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FWDnCP%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WDnCP
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $review, !1 = $categories
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'in_array'
          2        FETCH_DIM_R                                      ~2      !0, 'category'
          3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6      > RETURN                                                   $3
   17     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FWDnCP%3A15%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.75 ms | 1395 KiB | 19 Q