3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Madrid'); $start = new DateTime('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: ' . $start->format('r') . PHP_EOL; foreach ($increments as $increment => $expected_string) { echo '>>> ' . $increment . PHP_EOL; $expected_end = new DateTime($expected_string); $actual_end = clone $start; $actual_end->modify($increment); echo 'Expected end: ' . $expected_end->format('r') . PHP_EOL; echo 'Actual end: ' . $actual_end->format('r') . PHP_EOL; echo ($expected_end->format('c')===$actual_end->format('c') ? 'OK' : 'ERROR') . PHP_EOL; echo PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 56
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 56
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 51
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
filename:       /in/BidZS
function name:  (null)
number of ops:  58
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        NEW                                              $7      'DateTime'
          4        SEND_VAL_EX                                              '2017-03-26+01%3A59%3A00'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $7
    6     7        ASSIGN                                                   !1, <array>
   11     8        INIT_METHOD_CALL                                         !0, 'format'
          9        SEND_VAL_EX                                              'r'
         10        DO_FCALL                                      0  $11     
         11        CONCAT                                           ~12     'Start%3A++++++++', $11
         12        CONCAT                                           ~13     ~12, '%0A'
         13        ECHO                                                     ~13
   12    14      > FE_RESET_R                                       $14     !1, ->56
         15    > > FE_FETCH_R                                       ~15     $14, !2, ->56
         16    >   ASSIGN                                                   !3, ~15
   13    17        CONCAT                                           ~17     '%3E%3E%3E+', !3
         18        CONCAT                                           ~18     ~17, '%0A'
         19        ECHO                                                     ~18
   15    20        NEW                                              $19     'DateTime'
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !4, $19
   16    24        CLONE                                            ~22     !0
         25        ASSIGN                                                   !5, ~22
   17    26        INIT_METHOD_CALL                                         !5, 'modify'
         27        SEND_VAR_EX                                              !3
         28        DO_FCALL                                      0          
   19    29        INIT_METHOD_CALL                                         !4, 'format'
         30        SEND_VAL_EX                                              'r'
         31        DO_FCALL                                      0  $25     
         32        CONCAT                                           ~26     'Expected+end%3A+', $25
         33        CONCAT                                           ~27     ~26, '%0A'
         34        ECHO                                                     ~27
   20    35        INIT_METHOD_CALL                                         !5, 'format'
         36        SEND_VAL_EX                                              'r'
         37        DO_FCALL                                      0  $28     
         38        CONCAT                                           ~29     'Actual+end%3A+++', $28
         39        CONCAT                                           ~30     ~29, '%0A'
         40        ECHO                                                     ~30
   21    41        INIT_METHOD_CALL                                         !4, 'format'
         42        SEND_VAL_EX                                              'c'
         43        DO_FCALL                                      0  $31     
         44        INIT_METHOD_CALL                                         !5, 'format'
         45        SEND_VAL_EX                                              'c'
         46        DO_FCALL                                      0  $32     
         47        IS_IDENTICAL                                             $31, $32
         48      > JMPZ                                                     ~33, ->51
         49    >   QM_ASSIGN                                        ~34     'OK'
         50      > JMP                                                      ->52
         51    >   QM_ASSIGN                                        ~34     'ERROR'
         52    >   CONCAT                                           ~35     ~34, '%0A'
         53        ECHO                                                     ~35
   22    54        ECHO                                                     '%0A'
   12    55      > JMP                                                      ->15
         56    >   FE_FREE                                                  $14
   23    57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.79 ms | 1404 KiB | 15 Q