3v4l.org

run code in 300+ PHP versions simultaneously
<?php $steps = [ 2500, 5000, 10000, ]; for ($i = 0, $count = count($steps); $i < $count; $i++) { $step = $steps[$i] + 1; $previousStepDiff = $step - ($steps[$i-1] ?? $steps[0]); echo <<<sql select avg(requestTimeSec) from {tableName} where {column} between ((select max({column}) from {tableName}) - {$step}) and (((select max({column}) from {tableName}) - {$previousStepDiff})) sql; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 5
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 5
Branch analysis from position: 24
Branch analysis from position: 5
filename:       /in/6InU2
function name:  (null)
number of ops:  25
compiled vars:  !0 = $steps, !1 = $i, !2 = $count, !3 = $step, !4 = $previousStepDiff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, 0
          2        COUNT                                            ~7      !0
          3        ASSIGN                                                   !2, ~7
          4      > JMP                                                      ->22
    9     5    >   FETCH_DIM_R                                      ~9      !0, !1
          6        ADD                                              ~10     ~9, 1
          7        ASSIGN                                                   !3, ~10
   10     8        SUB                                              ~12     !1, 1
          9        FETCH_DIM_IS                                     ~13     !0, ~12
         10        COALESCE                                         ~14     ~13
         11        FETCH_DIM_R                                      ~15     !0, 0
         12        QM_ASSIGN                                        ~14     ~15
         13        SUB                                              ~16     !3, ~14
         14        ASSIGN                                                   !4, ~16
   12    15        ROPE_INIT                                     5  ~19     'select+avg%28requestTimeSec%29%0Afrom+%7BtableName%7D%0Awhere+%7Bcolumn%7D+between+%28%28select+max%28%7Bcolumn%7D%29+from+%7BtableName%7D%29+-+'
   14    16        ROPE_ADD                                      1  ~19     ~19, !3
         17        ROPE_ADD                                      2  ~19     ~19, '%29+and+%28%28%28select+max%28%7Bcolumn%7D%29+from+%7BtableName%7D%29+-+'
         18        ROPE_ADD                                      3  ~19     ~19, !4
         19        ROPE_END                                      4  ~18     ~19, '%29%29%0A'
         20        ECHO                                                     ~18
    8    21        PRE_INC                                                  !1
         22    >   IS_SMALLER                                               !1, !2
         23      > JMPNZ                                                    ~23, ->5
   17    24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.92 ms | 1394 KiB | 13 Q