3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Prague'); $start = strtotime('1900-01-01 00:00:00'); $dates = array('2013-01-01 00:01:59', '2013-01-03 11:12:05', '2012-10-28 23:07:06'); foreach ($dates as $d) { $timestamp = strtotime($d); $diff = $timestamp - $start; $daysDiff = floor($diff/(60*60*24)); $dateFact = $daysDiff + 1; echo $diff - $daysDiff.PHP_EOL; echo $dateFact.PHP_EOL.PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 30
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 30
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/l71ki
function name:  (null)
number of ops:  32
compiled vars:  !0 = $start, !1 = $dates, !2 = $d, !3 = $timestamp, !4 = $diff, !5 = $daysDiff, !6 = $dateFact
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FPrague'
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'strtotime'
          4        SEND_VAL                                                 '1900-01-01+00%3A00%3A00'
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !0, $8
    4     7        ASSIGN                                                   !1, <array>
    5     8      > FE_RESET_R                                       $11     !1, ->30
          9    > > FE_FETCH_R                                               $11, !2, ->30
    6    10    >   INIT_FCALL                                               'strtotime'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !3, $12
    7    14        SUB                                              ~14     !3, !0
         15        ASSIGN                                                   !4, ~14
    8    16        INIT_FCALL                                               'floor'
         17        DIV                                              ~16     !4, 86400
         18        SEND_VAL                                                 ~16
         19        DO_ICALL                                         $17     
         20        ASSIGN                                                   !5, $17
    9    21        ADD                                              ~19     !5, 1
         22        ASSIGN                                                   !6, ~19
   10    23        SUB                                              ~21     !4, !5
         24        CONCAT                                           ~22     ~21, '%0A'
         25        ECHO                                                     ~22
   11    26        CONCAT                                           ~23     !6, '%0A'
         27        CONCAT                                           ~24     ~23, '%0A'
         28        ECHO                                                     ~24
    5    29      > JMP                                                      ->9
         30    >   FE_FREE                                                  $11
   12    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.62 ms | 1396 KiB | 19 Q