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 >= $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 = 36
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 36
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 35
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 35
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/BoO9o
function name:  (null)
number of ops:  41
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, ->36
         21    > > FE_FETCH_R                                               $21, !4, ->36
    7    22    >   ADD                                              ~22     !0, 86400
         23        IS_SMALLER_OR_EQUAL                                      !4, ~22
         24      > JMPZ                                                     ~23, ->27
    8    25    >   PRE_INC                                                  !3
         26      > JMP                                                      ->35
   10    27    >   ASSIGN_OP                                     1          !0, 86400
   11    28        INIT_FCALL                                               'array_push'
         29        SEND_REF                                                 !2
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                                 
   12    32        IS_NOT_EQUAL                                             !3, 0
         33      > JMPZ                                                     ~27, ->35
   13    34    >   ASSIGN                                                   !3, 0
    6    35    > > JMP                                                      ->21
         36    >   FE_FREE                                                  $21
   17    37        INIT_FCALL                                               'var_dump'
         38        SEND_VAR                                                 !2
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.6 ms | 1400 KiB | 19 Q