3v4l.org

run code in 300+ PHP versions simultaneously
<?php $certificates = array( array( 'num' => '111', 'name' => 'cert1' ), array( 'num' => '222', 'name' => 'cert2' ), ); $field = 'name'; $value = 'cert1'; $out = array_filter( $certificates, function($certificates) use ($field, $value) { return $certificates[$field] == $value; } ); print_r($out);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2KsK
function name:  (null)
number of ops:  15
compiled vars:  !0 = $certificates, !1 = $field, !2 = $value, !3 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, 'name'
   16     2        ASSIGN                                                   !2, 'cert1'
   18     3        INIT_FCALL                                               'array_filter'
   19     4        SEND_VAR                                                 !0
   20     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fr2KsK%3A20%240'
          6        BIND_LEXICAL                                             ~7, !1
          7        BIND_LEXICAL                                             ~7, !2
   22     8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
   18    10        ASSIGN                                                   !3, $8
   25    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fr2KsK%3A20%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2KsK
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $certificates, !1 = $field, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
   21     3        FETCH_DIM_R                                      ~3      !0, !1
          4        IS_EQUAL                                         ~4      !2, ~3
          5      > RETURN                                                   ~4
   22     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fr2KsK%3A20%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.55 ms | 1395 KiB | 17 Q