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]; $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 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 5
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 5
Branch analysis from position: 23
Branch analysis from position: 5
filename:       /in/JqfUn
function name:  (null)
number of ops:  24
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                                                      ->21
    9     5    >   FETCH_DIM_R                                      ~9      !0, !1
          6        ASSIGN                                                   !3, ~9
   10     7        SUB                                              ~11     !1, 1
          8        FETCH_DIM_IS                                     ~12     !0, ~11
          9        COALESCE                                         ~13     ~12
         10        FETCH_DIM_R                                      ~14     !0, 0
         11        QM_ASSIGN                                        ~13     ~14
         12        SUB                                              ~15     !3, ~13
         13        ASSIGN                                                   !4, ~15
   12    14        ROPE_INIT                                     5  ~18     'select+avg%28requestTimeSec%29%0Afrom+%7BtableName%7D%0Awhere+%7Bcolumn%7D+between+%28%28select+max%28%7Bcolumn%7D%29+from+%7BtableName%7D%29+-+'
   14    15        ROPE_ADD                                      1  ~18     ~18, !3
         16        ROPE_ADD                                      2  ~18     ~18, '%29+and+%28%28%28select+max%28%7Bcolumn%7D%29+from+%7BtableName%7D%29+-+'
         17        ROPE_ADD                                      3  ~18     ~18, !4
         18        ROPE_END                                      4  ~17     ~18, '%29%29%0A'
         19        ECHO                                                     ~17
    8    20        PRE_INC                                                  !1
         21    >   IS_SMALLER                                               !1, !2
         22      > JMPNZ                                                    ~22, ->5
   17    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.02 ms | 1394 KiB | 13 Q