3v4l.org

run code in 300+ PHP versions simultaneously
<?php // In the beginning there are no Sundays counted yet $number_of_sundays = 0; // Make the following actions for all years of the twentieth century for ($current_year = 1900; $current_year <= 1999; $current_year++) { //Make the following actions for all months from January to December for ($current_month = 1; $current_month <= 12; $current_month++) { // Get Unix Timestamp of the current month and year on the first day of the month $current_date = mktime(0, 0, 0, $current_month, 01, $current_year); $get_day_of_week = date("D", $current_date); if ($get_day_of_week == "Sun") { $number_of_sundays++; echo "01.".$current_month.".".$current_year." was a Sunday!"."\n"; } } } echo $number_of_sundays;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 3
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 5
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 3
Branch analysis from position: 34
Branch analysis from position: 3
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 5
Branch analysis from position: 31
Branch analysis from position: 5
Branch analysis from position: 28
filename:       /in/SqaqR
function name:  (null)
number of ops:  36
compiled vars:  !0 = $number_of_sundays, !1 = $current_year, !2 = $current_month, !3 = $current_date, !4 = $get_day_of_week
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    6     1        ASSIGN                                                   !1, 1900
          2      > JMP                                                      ->32
    8     3    >   ASSIGN                                                   !2, 1
          4      > JMP                                                      ->29
   10     5    >   INIT_FCALL                                               'mktime'
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 0
          9        SEND_VAR                                                 !2
         10        SEND_VAL                                                 1
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !3, $8
   12    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'D'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !4, $10
   14    19        IS_EQUAL                                                 !4, 'Sun'
         20      > JMPZ                                                     ~12, ->28
   15    21    >   PRE_INC                                                  !0
   16    22        CONCAT                                           ~14     '01.', !2
         23        CONCAT                                           ~15     ~14, '.'
         24        CONCAT                                           ~16     ~15, !1
         25        CONCAT                                           ~17     ~16, '+was+a+Sunday%21'
         26        CONCAT                                           ~18     ~17, '%0A'
         27        ECHO                                                     ~18
    8    28    >   PRE_INC                                                  !2
         29    >   IS_SMALLER_OR_EQUAL                                      !2, 12
         30      > JMPNZ                                                    ~20, ->5
    6    31    >   PRE_INC                                                  !1
         32    >   IS_SMALLER_OR_EQUAL                                      !1, 1999
         33      > JMPNZ                                                    ~22, ->3
   21    34    >   ECHO                                                     !0
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.45 ms | 1404 KiB | 17 Q