3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filter($array, callable $c) { $result = []; foreach ($array as $key => $value) { if ($c($value, $key)) { $result[$key] = $value; } } return $result; } var_dump(filter(['foo', '', 'bar'], function ($value) { return strlen($value); })); // Internal functions already throw on superfluous args var_dump(filter(['foo', '', 'bar'], 'strlen'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0QdoS
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'filter'
          2        SEND_VAL                                                 <array>
          3        DECLARE_LAMBDA_FUNCTION                          ~0      [0]
   15     4        SEND_VAL                                                 ~0
   13     5        DO_FCALL                                      0  $1      
   15     6        SEND_VAR                                                 $1
   13     7        DO_ICALL                                                 
   18     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'filter'
         10        SEND_VAL                                                 <array>
         11        SEND_VAL                                                 'strlen'
         12        DO_FCALL                                      0  $3      
         13        SEND_VAR                                                 $3
         14        DO_ICALL                                                 
         15      > 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/0QdoS
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        STRLEN                                           ~1      !0
          2      > RETURN                                                   ~1
   15     3*     > RETURN                                                   null

End of Dynamic Function 0

Function filter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/0QdoS
function name:  filter
number of ops:  17
compiled vars:  !0 = $array, !1 = $c, !2 = $result, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, <array>
    5     3      > FE_RESET_R                                       $6      !0, ->14
          4    > > FE_FETCH_R                                       ~7      $6, !3, ->14
          5    >   ASSIGN                                                   !4, ~7
    6     6        INIT_DYNAMIC_CALL                                        !1
          7        SEND_VAR_EX                                              !3
          8        SEND_VAR_EX                                              !4
          9        DO_FCALL                                      0  $9      
         10      > JMPZ                                                     $9, ->13
    7    11    >   ASSIGN_DIM                                               !2, !4
         12        OP_DATA                                                  !3
    5    13    > > JMP                                                      ->4
         14    >   FE_FREE                                                  $6
   10    15      > RETURN                                                   !2
   11    16*     > RETURN                                                   null

End of function filter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.34 ms | 1005 KiB | 16 Q