3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Madrid'); $start = strtotime('2017-03-26 01:59:00'); $increments = array( '+60 minutes' => '2017-03-26 03:59:00', '+61 minutes' => '2017-03-26 04:00:00', ); echo 'Start: ' . date('r', $start) . PHP_EOL; foreach ($increments as $increment => $expected_string) { echo '>>> ' . $increment . PHP_EOL; $expected_end = strtotime($expected_string); $actual_end = strtotime($increment, $start); echo 'Expected end: ' . date('r', $expected_end) . PHP_EOL; echo 'Actual end: ' . date('r', $actual_end) . PHP_EOL; echo ($expected_end===$actual_end ? 'OK' : 'ERROR') . PHP_EOL; echo PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 53
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 53
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
filename:       /in/bJlot
function name:  (null)
number of ops:  55
compiled vars:  !0 = $start, !1 = $increments, !2 = $expected_string, !3 = $increment, !4 = $expected_end, !5 = $actual_end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FMadrid'
          2        DO_ICALL                                                 
    5     3        INIT_FCALL                                               'strtotime'
          4        SEND_VAL                                                 '2017-03-26+01%3A59%3A00'
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !0, $7
    6     7        ASSIGN                                                   !1, <array>
   11     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'r'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $10     
         12        CONCAT                                           ~11     'Start%3A++++++++', $10
         13        CONCAT                                           ~12     ~11, '%0A'
         14        ECHO                                                     ~12
   12    15      > FE_RESET_R                                       $13     !1, ->53
         16    > > FE_FETCH_R                                       ~14     $13, !2, ->53
         17    >   ASSIGN                                                   !3, ~14
   13    18        CONCAT                                           ~16     '%3E%3E%3E+', !3
         19        CONCAT                                           ~17     ~16, '%0A'
         20        ECHO                                                     ~17
   15    21        INIT_FCALL                                               'strtotime'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $18     
         24        ASSIGN                                                   !4, $18
   16    25        INIT_FCALL                                               'strtotime'
         26        SEND_VAR                                                 !3
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $20     
         29        ASSIGN                                                   !5, $20
   18    30        INIT_FCALL                                               'date'
         31        SEND_VAL                                                 'r'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                         $22     
         34        CONCAT                                           ~23     'Expected+end%3A+', $22
         35        CONCAT                                           ~24     ~23, '%0A'
         36        ECHO                                                     ~24
   19    37        INIT_FCALL                                               'date'
         38        SEND_VAL                                                 'r'
         39        SEND_VAR                                                 !5
         40        DO_ICALL                                         $25     
         41        CONCAT                                           ~26     'Actual+end%3A+++', $25
         42        CONCAT                                           ~27     ~26, '%0A'
         43        ECHO                                                     ~27
   20    44        IS_IDENTICAL                                             !4, !5
         45      > JMPZ                                                     ~28, ->48
         46    >   QM_ASSIGN                                        ~29     'OK'
         47      > JMP                                                      ->49
         48    >   QM_ASSIGN                                        ~29     'ERROR'
         49    >   CONCAT                                           ~30     ~29, '%0A'
         50        ECHO                                                     ~30
   21    51        ECHO                                                     '%0A'
   12    52      > JMP                                                      ->16
         53    >   FE_FREE                                                  $13
   22    54      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
277.48 ms | 1400 KiB | 20 Q