3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array( 'type' => 'checkbox', 'id' => 'f0', 'is_active' => 1 ), array( 'type' => 'checkbox', 'id' => 'f1', 'is_active' => 0 ), array( 'type' => 'radio', 'id' => 'f2', 'is_active' => 0 ), array( 'type' => 'checkbox', 'id' => 'f3', 'is_active' => 1 ), array( 'type' => 'text', 'id' => 'f4', 'is_active' => 1 ) ); $filtered = array_filter($array, function($v){return $v['type'] == 'checkbox' && $v['is_active'] == 1;}); print_r($filtered);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/idAR4
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $filtered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   29     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
   30     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/idAR4
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 'type'
          2        IS_EQUAL                                         ~2      ~1, 'checkbox'
          3      > JMPZ_EX                                          ~2      ~2, ->7
          4    >   FETCH_DIM_R                                      ~3      !0, 'is_active'
          5        IS_EQUAL                                         ~4      ~3, 1
          6        BOOL                                             ~2      ~4
          7    > > RETURN                                                   ~2
          8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.74 ms | 1011 KiB | 15 Q