3v4l.org

run code in 300+ PHP versions simultaneously
<?php $from = time(); $times = array($from, $from+86400, $from+86400+86400+86400, $from+86400+86400+86400+86400+86400+86400); $days = array(); $countPerDay = 0; foreach ($times as $time) { if ($from + 86400 - 1 > $time) { $countPerDay++; } else { $from += 86400; array_push($days, $countPerDay); if ($countPerDay != 0) { $countPerDay = 0; } } } var_dump($days);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 37
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 37
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 36
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/p1hMh
function name:  (null)
number of ops:  42
compiled vars:  !0 = $from, !1 = $times, !2 = $days, !3 = $countPerDay, !4 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $5      
          2        ASSIGN                                                   !0, $5
    3     3        INIT_ARRAY                                       ~7      !0
          4        ADD                                              ~8      !0, 86400
          5        ADD_ARRAY_ELEMENT                                ~7      ~8
          6        ADD                                              ~9      !0, 86400
          7        ADD                                              ~10     ~9, 86400
          8        ADD                                              ~11     ~10, 86400
          9        ADD_ARRAY_ELEMENT                                ~7      ~11
         10        ADD                                              ~12     !0, 86400
         11        ADD                                              ~13     ~12, 86400
         12        ADD                                              ~14     ~13, 86400
         13        ADD                                              ~15     ~14, 86400
         14        ADD                                              ~16     ~15, 86400
         15        ADD                                              ~17     ~16, 86400
         16        ADD_ARRAY_ELEMENT                                ~7      ~17
         17        ASSIGN                                                   !1, ~7
    4    18        ASSIGN                                                   !2, <array>
    5    19        ASSIGN                                                   !3, 0
    6    20      > FE_RESET_R                                       $21     !1, ->37
         21    > > FE_FETCH_R                                               $21, !4, ->37
    7    22    >   ADD                                              ~22     !0, 86400
         23        SUB                                              ~23     ~22, 1
         24        IS_SMALLER                                               !4, ~23
         25      > JMPZ                                                     ~24, ->28
    8    26    >   PRE_INC                                                  !3
         27      > JMP                                                      ->36
   10    28    >   ASSIGN_OP                                     1          !0, 86400
   11    29        INIT_FCALL                                               'array_push'
         30        SEND_REF                                                 !2
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                                 
   12    33        IS_NOT_EQUAL                                             !3, 0
         34      > JMPZ                                                     ~28, ->36
   13    35    >   ASSIGN                                                   !3, 0
    6    36    > > JMP                                                      ->21
         37    >   FE_FREE                                                  $21
   17    38        INIT_FCALL                                               'var_dump'
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                                 
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.08 ms | 1392 KiB | 19 Q