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 = date($format, strtotime('-1 month', strtotime("2013-{$month}-31 00:00:01"))); var_dump($date); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 27
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/EnRvj
function name:  (null)
number of ops:  29
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, ->27
          7    > > FE_FETCH_R                                               $10, !3, ->27
   10     8    >   INIT_FCALL                                               'date'
          9        SEND_VAR                                                 !2
         10        INIT_FCALL                                               'strtotime'
         11        SEND_VAL                                                 '-1+month'
         12        INIT_FCALL                                               'strtotime'
         13        ROPE_INIT                                     3  ~12     '2013-'
         14        ROPE_ADD                                      1  ~12     ~12, !3
         15        ROPE_END                                      2  ~11     ~12, '-31+00%3A00%3A01'
         16        SEND_VAL                                                 ~11
         17        DO_ICALL                                         $14     
         18        SEND_VAR                                                 $14
         19        DO_ICALL                                         $15     
         20        SEND_VAR                                                 $15
         21        DO_ICALL                                         $16     
         22        ASSIGN                                                   !4, $16
   11    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                                 
    9    26      > JMP                                                      ->7
         27    >   FE_FREE                                                  $10
   12    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.75 ms | 1401 KiB | 19 Q