3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original = ['test' => 'test', 'test2'=>'another test', 'test3' => 'third test']; $address = ['test' => 'test', 'test2'=>'another test', 'test3' => 'third test diff', 'test4' => 'ignore me bro']; $changes = array_filter($original, function ($key, $data) use ($address) { return $data === $address->getData($key); }, ARRAY_FILTER_USE_BOTH); var_dump($changes);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9vLKU
function name:  (null)
number of ops:  14
compiled vars:  !0 = $original, !1 = $address, !2 = $changes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9vLKU%3A7%240'
          5        BIND_LEXICAL                                             ~5, !1
    9     6        SEND_VAL                                                 ~5
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $6      
    7     9        ASSIGN                                                   !2, $6
   11    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F9vLKU%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9vLKU
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $key, !1 = $data, !2 = $address
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    8     3        INIT_METHOD_CALL                                         !2, 'getData'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $3      
          6        IS_IDENTICAL                                     ~4      !1, $3
          7      > RETURN                                                   ~4
    9     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F9vLKU%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.28 ms | 1395 KiB | 17 Q