3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [1, 999, 1000, 50001, 100000, 2999]; foreach ($tests as $test) { $upper = intval(($test - 1) / 1000) * 1000 + 1000; echo "$test is between " . ($upper - 999) . " and $upper\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/jDbsp
function name:  (null)
number of ops:  21
compiled vars:  !0 = $tests, !1 = $test, !2 = $upper
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $4      !0, ->19
          2    > > FE_FETCH_R                                               $4, !1, ->19
    6     3    >   SUB                                              ~5      !1, 1
          4        DIV                                              ~6      ~5, 1000
          5        CAST                                          4  ~7      ~6
          6        MUL                                              ~8      ~7, 1000
          7        ADD                                              ~9      ~8, 1000
          8        ASSIGN                                                   !2, ~9
    7     9        NOP                                                      
         10        FAST_CONCAT                                      ~11     !1, '+is+between+'
         11        SUB                                              ~12     !2, 999
         12        CONCAT                                           ~13     ~11, ~12
         13        ROPE_INIT                                     3  ~15     '+and+'
         14        ROPE_ADD                                      1  ~15     ~15, !2
         15        ROPE_END                                      2  ~14     ~15, '%0A'
         16        CONCAT                                           ~17     ~13, ~14
         17        ECHO                                                     ~17
    5    18      > JMP                                                      ->2
         19    >   FE_FREE                                                  $4
    8    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
240.68 ms | 998 KiB | 13 Q