3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0; $b = 2000000; $k = 40; echo count(array_filter(range($a, $b), function ($i) use ($k) { return $i % $k === 0; }));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bFX2v
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 0
    5     1        ASSIGN                                                   !1, 2000000
    6     2        ASSIGN                                                   !2, 40
    8     3        INIT_FCALL                                               'array_filter'
          4        INIT_FCALL                                               'range'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FbFX2v%3A8%240'
         10        BIND_LEXICAL                                             ~7, !2
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        COUNT                                            ~9      $8
         14        ECHO                                                     ~9
         15      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FbFX2v%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.48 ms | 1387 KiB | 17 Q