3v4l.org

run code in 300+ PHP versions simultaneously
<?php $thirtyOnedayMonths = array( 1, 3, 5, 7, 8, 10, 12 ); $oneMonth = new \DateInterval('P1M'); $format = 'Y-m-d'; foreach($thirtyOnedayMonths as $month){ $date = new \DateTime("2013-{$month}-31 00:00:01"); var_dump($date->format($format)); $date->sub($oneMonth); var_dump($date->format($format)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 31
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 31
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/12RRo
function name:  (null)
number of ops:  33
compiled vars:  !0 = $thirtyOnedayMonths, !1 = $oneMonth, !2 = $format, !3 = $month, !4 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    6     1        NEW                                              $6      'DateInterval'
          2        SEND_VAL_EX                                              'P1M'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    7     5        ASSIGN                                                   !2, 'Y-m-d'
    9     6      > FE_RESET_R                                       $10     !0, ->31
          7    > > FE_FETCH_R                                               $10, !3, ->31
   10     8    >   NEW                                              $11     'DateTime'
          9        ROPE_INIT                                     3  ~13     '2013-'
         10        ROPE_ADD                                      1  ~13     ~13, !3
         11        ROPE_END                                      2  ~12     ~13, '-31+00%3A00%3A01'
         12        SEND_VAL_EX                                              ~12
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !4, $11
   11    15        INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !4, 'format'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $17     
         19        SEND_VAR                                                 $17
         20        DO_ICALL                                                 
   12    21        INIT_METHOD_CALL                                         !4, 'sub'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0          
   13    24        INIT_FCALL                                               'var_dump'
         25        INIT_METHOD_CALL                                         !4, 'format'
         26        SEND_VAR_EX                                              !2
         27        DO_FCALL                                      0  $20     
         28        SEND_VAR                                                 $20
         29        DO_ICALL                                                 
    9    30      > JMP                                                      ->7
         31    >   FE_FREE                                                  $10
   14    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.16 ms | 1396 KiB | 15 Q