3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/New_York'); $start = new DateTime('this year'); $end = new DateTime('+10 years'); $interval = new DateInterval('P1Y'); $adjust = 'fourth thursday of November'; $period = new DatePeriod($start, $interval, $end); foreach($period as $holiday) { $holiday->modify($adjust); echo "Thanksgiving in {$holiday->format('Y')} will be on {$holiday->format('l F jS')}\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 40
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 40
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/FV18R
function name:  (null)
number of ops:  42
compiled vars:  !0 = $start, !1 = $end, !2 = $interval, !3 = $adjust, !4 = $period, !5 = $holiday
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'America%2FNew_York'
          2        DO_ICALL                                                 
    3     3        NEW                                              $7      'DateTime'
          4        SEND_VAL_EX                                              'this+year'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $7
    4     7        NEW                                              $10     'DateTime'
          8        SEND_VAL_EX                                              '%2B10+years'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $10
    5    11        NEW                                              $13     'DateInterval'
         12        SEND_VAL_EX                                              'P1Y'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $13
    6    15        ASSIGN                                                   !3, 'fourth+thursday+of+November'
    7    16        NEW                                              $17     'DatePeriod'
         17        SEND_VAR_EX                                              !0
         18        SEND_VAR_EX                                              !2
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !4, $17
    9    22      > FE_RESET_R                                       $20     !4, ->40
         23    > > FE_FETCH_R                                               $20, !5, ->40
   10    24    >   INIT_METHOD_CALL                                         !5, 'modify'
         25        SEND_VAR_EX                                              !3
         26        DO_FCALL                                      0          
   11    27        ROPE_INIT                                     5  ~25     'Thanksgiving+in+'
         28        INIT_METHOD_CALL                                         !5, 'format'
         29        SEND_VAL_EX                                              'Y'
         30        DO_FCALL                                      0  $22     
         31        ROPE_ADD                                      1  ~25     ~25, $22
         32        ROPE_ADD                                      2  ~25     ~25, '+will+be+on+'
         33        INIT_METHOD_CALL                                         !5, 'format'
         34        SEND_VAL_EX                                              'l+F+jS'
         35        DO_FCALL                                      0  $23     
         36        ROPE_ADD                                      3  ~25     ~25, $23
         37        ROPE_END                                      4  ~24     ~25, '%0A'
         38        ECHO                                                     ~24
    9    39      > JMP                                                      ->23
         40    >   FE_FREE                                                  $20
   12    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.34 ms | 1400 KiB | 15 Q