3v4l.org

run code in 300+ PHP versions simultaneously
<?php $frmdate = "2015-06-05"; $todate = "2015-08-31"; for ($date = strtotime($frmdate); $date <= strtotime($todate); $date = strtotime("+1 day", $date)) { $custom_day = date("D", $date); $dte = date("Y-m-d", $date); if($custom_day == 'Sat') $custom_third_sat[] = date('Y-m-d', strtotime("third Saturday of $dte")); } echo "<pre>"; print_r(array_unique($custom_third_sat));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 7
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 30
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 7
Branch analysis from position: 40
Branch analysis from position: 7
Branch analysis from position: 30
filename:       /in/HKVqH
function name:  (null)
number of ops:  48
compiled vars:  !0 = $frmdate, !1 = $todate, !2 = $date, !3 = $custom_day, !4 = $dte, !5 = $custom_third_sat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2015-06-05'
    4     1        ASSIGN                                                   !1, '2015-08-31'
    6     2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !2, $8
          6      > JMP                                                      ->35
    8     7    >   INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'D'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $10     
         11        ASSIGN                                                   !3, $10
    9    12        INIT_FCALL                                               'date'
         13        SEND_VAL                                                 'Y-m-d'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !4, $12
   10    17        IS_EQUAL                                                 !3, 'Sat'
         18      > JMPZ                                                     ~14, ->30
   11    19    >   INIT_FCALL                                               'date'
         20        SEND_VAL                                                 'Y-m-d'
         21        INIT_FCALL                                               'strtotime'
         22        NOP                                                      
         23        FAST_CONCAT                                      ~16     'third+Saturday+of+', !4
         24        SEND_VAL                                                 ~16
         25        DO_ICALL                                         $17     
         26        SEND_VAR                                                 $17
         27        DO_ICALL                                         $18     
         28        ASSIGN_DIM                                               !5
         29        OP_DATA                                                  $18
    6    30    >   INIT_FCALL                                               'strtotime'
         31        SEND_VAL                                                 '%2B1+day'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $19     
         34        ASSIGN                                                   !2, $19
         35    >   INIT_FCALL                                               'strtotime'
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                         $21     
         38        IS_SMALLER_OR_EQUAL                                      !2, $21
         39      > JMPNZ                                                    ~22, ->7
   14    40    >   ECHO                                                     '%3Cpre%3E'
   15    41        INIT_FCALL                                               'print_r'
         42        INIT_FCALL                                               'array_unique'
         43        SEND_VAR                                                 !5
         44        DO_ICALL                                         $23     
         45        SEND_VAR                                                 $23
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.47 ms | 1405 KiB | 21 Q