3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Prague'); $originalDate = new DateTime('2011-11-11'); $modifiedDate = $originalDate->modify('+1 year'); assert($originalDate !== $modifiedDate); assert($modifiedDate->format('Y-m-d') === '2012-11-11'); assert($originalDate->format('Y-m-d') === '2011-11-11');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WKKXb
function name:  (null)
number of ops:  36
compiled vars:  !0 = $originalDate, !1 = $modifiedDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FPrague'
          2        DO_ICALL                                                 
    4     3        NEW                                              $3      'DateTime'
          4        SEND_VAL_EX                                              '2011-11-11'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
    5     7        INIT_METHOD_CALL                                         !0, 'modify'
          8        SEND_VAL_EX                                              '%2B1+year'
          9        DO_FCALL                                      0  $6      
         10        ASSIGN                                                   !1, $6
    6    11        ASSERT_CHECK                                             
         12        INIT_FCALL                                               'assert'
         13        IS_NOT_IDENTICAL                                 ~8      !0, !1
         14        SEND_VAL                                                 ~8
         15        SEND_VAL                                                 'assert%28%24originalDate+%21%3D%3D+%24modifiedDate%29'
         16        DO_ICALL                                                 
    7    17        ASSERT_CHECK                                             
         18        INIT_FCALL                                               'assert'
         19        INIT_METHOD_CALL                                         !1, 'format'
         20        SEND_VAL_EX                                              'Y-m-d'
         21        DO_FCALL                                      0  $10     
         22        IS_IDENTICAL                                     ~11     $10, '2012-11-11'
         23        SEND_VAL                                                 ~11
         24        SEND_VAL                                                 'assert%28%24modifiedDate-%3Eformat%28%27Y-m-d%27%29+%3D%3D%3D+%272012-11-11%27%29'
         25        DO_ICALL                                                 
    8    26        ASSERT_CHECK                                             
         27        INIT_FCALL                                               'assert'
         28        INIT_METHOD_CALL                                         !0, 'format'
         29        SEND_VAL_EX                                              'Y-m-d'
         30        DO_FCALL                                      0  $13     
         31        IS_IDENTICAL                                     ~14     $13, '2011-11-11'
         32        SEND_VAL                                                 ~14
         33        SEND_VAL                                                 'assert%28%24originalDate-%3Eformat%28%27Y-m-d%27%29+%3D%3D%3D+%272011-11-11%27%29'
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.54 ms | 1396 KiB | 17 Q