3v4l.org

run code in 300+ PHP versions simultaneously
<?php $daysInMonth = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $timestampFailing = false; $errorCount = 0; for ($year = 1500; $year < 2000; $year++) { for ($month = 1; $month <= 12; $month++) { for ($day = 1; $day < $daysInMonth[$month]; $day++) { if ($errorCount > 10) { echo "too many errors."; exit; } $baseString = sprintf("%4d-%02d-%02d 00:00:00", $year, $month, $day); $timestamp = strtotime($baseString); // Currently failing, ignore if (!$timestamp && $timestampFailing) { continue; } // Newly failed: log and continue if (!$timestamp) { $timestampFailing = true; $errorCount++; echo "Timestamp failing start at $baseString\n"; continue; } // Stopped failing: log and continue if ($timestampFailing && $timestamp) { $timestampFailing = false; $errorCount++; echo "Timestamp failinng end at $baseString\n"; } // Failed round trip. $roundTrip = date("Y-m-d H:i:s", $timestamp); if ($baseString !== $roundTrip) { $errorCount++; echo "$baseString ($timestamp) $roundTrip\n"; } } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 5
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 7
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 5
Branch analysis from position: 72
Branch analysis from position: 5
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 9
Branch analysis from position: 66
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 7
Branch analysis from position: 69
Branch analysis from position: 7
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 9
Branch analysis from position: 66
Branch analysis from position: 9
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
Branch analysis from position: 38
2 jumps found. (Code = 46) Position 1 = 39, Position 2 = 40
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 47
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 62
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 9
Branch analysis from position: 66
Branch analysis from position: 9
Branch analysis from position: 62
Branch analysis from position: 47
Branch analysis from position: 40
Branch analysis from position: 27
filename:       /in/cQO0A
function name:  (null)
number of ops:  73
compiled vars:  !0 = $daysInMonth, !1 = $timestampFailing, !2 = $errorCount, !3 = $year, !4 = $month, !5 = $day, !6 = $baseString, !7 = $timestamp, !8 = $roundTrip
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <false>
    5     2        ASSIGN                                                   !2, 0
    6     3        ASSIGN                                                   !3, 1500
          4      > JMP                                                      ->70
    7     5    >   ASSIGN                                                   !4, 1
          6      > JMP                                                      ->67
    8     7    >   ASSIGN                                                   !5, 1
          8      > JMP                                                      ->63
    9     9    >   IS_SMALLER                                               10, !2
         10      > JMPZ                                                     ~15, ->13
   10    11    >   ECHO                                                     'too+many+errors.'
   11    12      > EXIT                                                     
   13    13    >   INIT_FCALL                                               'sprintf'
         14        SEND_VAL                                                 '%254d-%2502d-%2502d+00%3A00%3A00'
         15        SEND_VAR                                                 !3
         16        SEND_VAR                                                 !4
         17        SEND_VAR                                                 !5
         18        DO_ICALL                                         $16     
         19        ASSIGN                                                   !6, $16
   14    20        INIT_FCALL                                               'strtotime'
         21        SEND_VAR                                                 !6
         22        DO_ICALL                                         $18     
         23        ASSIGN                                                   !7, $18
   16    24        BOOL_NOT                                         ~20     !7
         25      > JMPZ_EX                                          ~20     ~20, ->27
         26    >   BOOL                                             ~20     !1
         27    > > JMPZ                                                     ~20, ->29
   17    28    > > JMP                                                      ->62
   20    29    >   BOOL_NOT                                         ~21     !7
         30      > JMPZ                                                     ~21, ->38
   21    31    >   ASSIGN                                                   !1, <true>
   22    32        PRE_INC                                                  !2
   23    33        ROPE_INIT                                     3  ~25     'Timestamp+failing+start+at+'
         34        ROPE_ADD                                      1  ~25     ~25, !6
         35        ROPE_END                                      2  ~24     ~25, '%0A'
         36        ECHO                                                     ~24
   24    37      > JMP                                                      ->62
   27    38    > > JMPZ_EX                                          ~27     !1, ->40
         39    >   BOOL                                             ~27     !7
         40    > > JMPZ                                                     ~27, ->47
   28    41    >   ASSIGN                                                   !1, <false>
   29    42        PRE_INC                                                  !2
   30    43        ROPE_INIT                                     3  ~31     'Timestamp+failinng+end+at+'
         44        ROPE_ADD                                      1  ~31     ~31, !6
         45        ROPE_END                                      2  ~30     ~31, '%0A'
         46        ECHO                                                     ~30
   34    47    >   INIT_FCALL                                               'date'
         48        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         49        SEND_VAR                                                 !7
         50        DO_ICALL                                         $33     
         51        ASSIGN                                                   !8, $33
   35    52        IS_NOT_IDENTICAL                                         !6, !8
         53      > JMPZ                                                     ~35, ->62
   36    54    >   PRE_INC                                                  !2
   37    55        ROPE_INIT                                     6  ~38     !6
         56        ROPE_ADD                                      1  ~38     ~38, '+%28'
         57        ROPE_ADD                                      2  ~38     ~38, !7
         58        ROPE_ADD                                      3  ~38     ~38, '%29+'
         59        ROPE_ADD                                      4  ~38     ~38, !8
         60        ROPE_END                                      5  ~37     ~38, '%0A'
         61        ECHO                                                     ~37
    8    62    >   PRE_INC                                                  !5
         63    >   FETCH_DIM_R                                      ~42     !0, !4
         64        IS_SMALLER                                               !5, ~42
         65      > JMPNZ                                                    ~43, ->9
    7    66    >   PRE_INC                                                  !4
         67    >   IS_SMALLER_OR_EQUAL                                      !4, 12
         68      > JMPNZ                                                    ~45, ->7
    6    69    >   PRE_INC                                                  !3
         70    >   IS_SMALLER                                               !3, 2000
         71      > JMPNZ                                                    ~47, ->5
   42    72    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.39 ms | 1396 KiB | 19 Q