3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('02/29/2020'); $interval = $date->format('L') && $date->format('m-d') == '02-29' ? 'P366D' : 'P1Y'; $date->sub(new DateInterval($interval)); echo $date->format('m/d/Y');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/4mXX4
function name:  (null)
number of ops:  29
compiled vars:  !0 = $date, !1 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              '02%2F29%2F2020'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    4     4        INIT_METHOD_CALL                                         !0, 'format'
          5        SEND_VAL_EX                                              'L'
          6        DO_FCALL                                      0  $5      
          7      > JMPZ_EX                                          ~6      $5, ->13
          8    >   INIT_METHOD_CALL                                         !0, 'format'
          9        SEND_VAL_EX                                              'm-d'
         10        DO_FCALL                                      0  $7      
         11        IS_EQUAL                                         ~8      $7, '02-29'
         12        BOOL                                             ~6      ~8
         13    > > JMPZ                                                     ~6, ->16
         14    >   QM_ASSIGN                                        ~9      'P366D'
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~9      'P1Y'
         17    >   ASSIGN                                                   !1, ~9
    5    18        INIT_METHOD_CALL                                         !0, 'sub'
         19        NEW                                              $11     'DateInterval'
         20        SEND_VAR_EX                                              !1
         21        DO_FCALL                                      0          
         22        SEND_VAR_NO_REF_EX                                       $11
         23        DO_FCALL                                      0          
    6    24        INIT_METHOD_CALL                                         !0, 'format'
         25        SEND_VAL_EX                                              'm%2Fd%2FY'
         26        DO_FCALL                                      0  $14     
         27        ECHO                                                     $14
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.67 ms | 1008 KiB | 13 Q