3v4l.org

run code in 500+ PHP versions simultaneously
<?php $requests = [-11, -1, 0, 1, 2]; foreach ($requests as $request) { $d = new DateTime('first day of this month'); $d->modify("$request month"); echo $d->format('Y') . ' & ' . $d->format('n') . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 23
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/DI9NLo
function name:  (null)
number of ops:  25
compiled vars:  !0 = $requests, !1 = $request, !2 = $d
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1      > FE_RESET_R                                           $4      !0, ->23
          2    > > FE_FETCH_R                                                   $4, !1, ->23
    6     3    >   NEW                                                  $5      'DateTime'
          4        SEND_VAL_EX                                                  'first+day+of+this+month'
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !2, $5
    7     7        INIT_METHOD_CALL                                             !2, 'modify'
          8        NOP                                                          
          9        FAST_CONCAT                                          ~8      !1, '+month'
         10        SEND_VAL_EX                                                  ~8
         11        DO_FCALL                                          0          
    8    12        INIT_METHOD_CALL                                             !2, 'format'
         13        SEND_VAL_EX                                                  'Y'
         14        DO_FCALL                                          0  $10     
         15        CONCAT                                               ~11     $10, '+%26+'
         16        INIT_METHOD_CALL                                             !2, 'format'
         17        SEND_VAL_EX                                                  'n'
         18        DO_FCALL                                          0  $12     
         19        CONCAT                                               ~13     ~11, $12
         20        CONCAT                                               ~14     ~13, '%0A'
         21        ECHO                                                         ~14
    5    22      > JMP                                                          ->2
         23    >   FE_FREE                                                      $4
    9    24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
223.98 ms | 2021 KiB | 13 Q