3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "foo" => "no", "foo_contact_firstname" => "Mark", "foo_email" => "mark@gmail.com", "foo_address1" => "91", "foo_address2" => "old road", "foo_bill" => "no", "bar" => "yes", "bar_contact_lastname" => null, "bar_telephone" => null, "bar_email" => null, "bar_address1" => null, "bar_address2" => null, "bar_address3" => null, "bar_address4" => null, "bar_address5" => null, "bar_postcode" => null, "register_contact_firstname" => null, "register_contact_lastname" => null, "register_telephone" => null, "register_email" => null, "register_address1" => null, "register_address2" => null, "register_address3" => null, "register_address4" => null, "register_address5" => null, "register_postcode" => null, ]; $test = array_filter($array, function($key) { return $key == 'foo'; }, ARRAY_FILTER_USE_KEY ); var_dump($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/39uul
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   33     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   36     4        SEND_VAL                                                 ~3
          5        SEND_VAL                                                 2
   33     6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
   38     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/39uul
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
   34     1        IS_EQUAL                                         ~1      !0, 'foo'
          2      > RETURN                                                   ~1
   36     3*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.43 ms | 1460 KiB | 15 Q