3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 2; $options = array(1,2,3,4); $options = array_filter($options, function($val) use ($a) { return ($val == $a); }); var_dump($options);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ri4V1
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !1
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fri4V1%3A5%240'
          5        BIND_LEXICAL                                             ~4, !0
    7     6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
    5     8        ASSIGN                                                   !1, $5
    8     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2Fri4V1%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.06 ms | 1395 KiB | 17 Q