3v4l.org

run code in 300+ PHP versions simultaneously
<?php $originalDate = new DateTimeImmutable('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/0huDm
function name:  (null)
number of ops:  33
compiled vars:  !0 = $originalDate, !1 = $modifiedDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DateTimeImmutable'
          1        SEND_VAL_EX                                              '2011-11-11'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    4     4        INIT_METHOD_CALL                                         !0, 'modify'
          5        SEND_VAL_EX                                              '%2B1+year'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
    5     8        ASSERT_CHECK                                             
          9        INIT_FCALL                                               'assert'
         10        IS_NOT_IDENTICAL                                 ~7      !0, !1
         11        SEND_VAL                                                 ~7
         12        SEND_VAL                                                 'assert%28%24originalDate+%21%3D%3D+%24modifiedDate%29'
         13        DO_ICALL                                                 
    6    14        ASSERT_CHECK                                             
         15        INIT_FCALL                                               'assert'
         16        INIT_METHOD_CALL                                         !1, 'format'
         17        SEND_VAL_EX                                              'Y-m-d'
         18        DO_FCALL                                      0  $9      
         19        IS_IDENTICAL                                     ~10     $9, '2012-11-11'
         20        SEND_VAL                                                 ~10
         21        SEND_VAL                                                 'assert%28%24modifiedDate-%3Eformat%28%27Y-m-d%27%29+%3D%3D%3D+%272012-11-11%27%29'
         22        DO_ICALL                                                 
    7    23        ASSERT_CHECK                                             
         24        INIT_FCALL                                               'assert'
         25        INIT_METHOD_CALL                                         !0, 'format'
         26        SEND_VAL_EX                                              'Y-m-d'
         27        DO_FCALL                                      0  $12     
         28        IS_IDENTICAL                                     ~13     $12, '2011-11-11'
         29        SEND_VAL                                                 ~13
         30        SEND_VAL                                                 'assert%28%24originalDate-%3Eformat%28%27Y-m-d%27%29+%3D%3D%3D+%272011-11-11%27%29'
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.04 ms | 1396 KiB | 15 Q