3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['a' => 5, 'b' => 10]; $f = function ($value, $key) { return $key === 'a' && $value = 5; }; var_dump(array_filter($a, $f, ARRAY_FILTER_USE_BOTH));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mk23R
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          2        ASSIGN                                                   !1, ~3
    9     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
         11      > 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 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/Mk23R
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $value, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        IS_IDENTICAL                                     ~2      !1, 'a'
          3      > JMPZ_EX                                          ~2      ~2, ->6
          4    >   ASSIGN                                           ~3      !0, 5
          5        BOOL                                             ~2      ~3
          6    > > RETURN                                                   ~2
    7     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
252.55 ms | 1001 KiB | 15 Q