3v4l.org

run code in 300+ PHP versions simultaneously
<?php $today = new DateTime(); $last_year=(new DateTime())->sub(new DateInterval('P1Y')); $next_year = (new DateTime())->add(new DateInterval('P1Y')); echo date_format($last_year, 'Y').' '.date_format($today, 'Y').' '.date_format($next_year, 'Y');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZRlpk
function name:  (null)
number of ops:  39
compiled vars:  !0 = $today, !1 = $last_year, !2 = $next_year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        NEW                                              $6      'DateTime'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $6, 'sub'
          6        NEW                                              $8      'DateInterval'
          7        SEND_VAL_EX                                              'P1Y'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $8
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !1, $10
    4    12        NEW                                              $12     'DateTime'
         13        DO_FCALL                                      0          
         14        INIT_METHOD_CALL                                         $12, 'add'
         15        NEW                                              $14     'DateInterval'
         16        SEND_VAL_EX                                              'P1Y'
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $14
         19        DO_FCALL                                      0  $16     
         20        ASSIGN                                                   !2, $16
    5    21        INIT_FCALL                                               'date_format'
         22        SEND_VAR                                                 !1
         23        SEND_VAL                                                 'Y'
         24        DO_ICALL                                         $18     
         25        CONCAT                                           ~19     $18, '+'
         26        INIT_FCALL                                               'date_format'
         27        SEND_VAR                                                 !0
         28        SEND_VAL                                                 'Y'
         29        DO_ICALL                                         $20     
         30        CONCAT                                           ~21     ~19, $20
         31        CONCAT                                           ~22     ~21, '+'
         32        INIT_FCALL                                               'date_format'
         33        SEND_VAR                                                 !2
         34        SEND_VAL                                                 'Y'
         35        DO_ICALL                                         $23     
         36        CONCAT                                           ~24     ~22, $23
         37        ECHO                                                     ~24
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.92 ms | 1396 KiB | 15 Q