3v4l.org

run code in 300+ PHP versions simultaneously
<?php $variable = Array( array( 'id'=>"1", 'file'=>"new" ), array( 'id'=>"2", 'file'=>"sample" ), array( 'id'=>"3", 'file'=>"new" ), array( 'id'=>"4", 'file'=>"garden" ), array( 'id'=>"5", 'file'=>"new" ), array( 'id'=>"6", 'file'=>"tem" ) ); $newarray = array_filter($variable, function($elem) {return isset($elem['file']) && $elem['file'] == 'new';}); print_r($newarray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NmqaM
function name:  (null)
number of ops:  11
compiled vars:  !0 = $variable, !1 = $newarray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNmqaM%3A11%240'
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
   13     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FNmqaM%3A11%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/NmqaM
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $elem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        ISSET_ISEMPTY_DIM_OBJ                         0  ~1      !0, 'file'
          2      > JMPZ_EX                                          ~1      ~1, ->6
          3    >   FETCH_DIM_R                                      ~2      !0, 'file'
          4        IS_EQUAL                                         ~3      ~2, 'new'
          5        BOOL                                             ~1      ~3
          6    > > RETURN                                                   ~1
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNmqaM%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.09 ms | 1395 KiB | 17 Q