3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_cat($ar){ return($ar['name'] == 'cat 1'); } $arr = array(0 => array("id"=>1,"name"=>"cat 1"), 1 => array("id"=>2,"name"=>"cat 2"), 2 => array("id"=>3,"name"=>"cat 1") ); $arr2 = array_filter($arr, "test_cat"); echo "<pre>"; print_r($arr2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JJmhl
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'test_cat'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   14     6        ECHO                                                     '%3Cpre%3E'
   15     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function test_cat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JJmhl
function name:  test_cat
number of ops:  5
compiled vars:  !0 = $ar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~1      !0, 'name'
          2        IS_EQUAL                                         ~2      ~1, 'cat+1'
          3      > RETURN                                                   ~2
    5     4*     > RETURN                                                   null

End of function test_cat

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.14 ms | 1395 KiB | 17 Q