3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month=12; $year=2014; // Mantech $startDate = strtotime($month.'/1/'.$year); $stopDate = strtotime('last day of this month ',$startDate); if (date('D',$startDate)!='Sat'){ $startDate = strtotime('next saturday',$startDate); } if (date('D',$stopDate)!='Fri'){ $stopDate = strtotime('next friday',$stopDate); } echo (date('Y-m-d',$startDate).' - '.date('Y-m-d',$stopDate));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 35
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 24
filename:       /in/tavgD
function name:  (null)
number of ops:  47
compiled vars:  !0 = $month, !1 = $year, !2 = $startDate, !3 = $stopDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 12
    3     1        ASSIGN                                                   !1, 2014
    6     2        INIT_FCALL                                               'strtotime'
          3        CONCAT                                           ~6      !0, '%2F1%2F'
          4        CONCAT                                           ~7      ~6, !1
          5        SEND_VAL                                                 ~7
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !2, $8
    7     8        INIT_FCALL                                               'strtotime'
          9        SEND_VAL                                                 'last+day+of+this+month+'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !3, $10
    9    13        INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'D'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        IS_NOT_EQUAL                                             $12, 'Sat'
         18      > JMPZ                                                     ~13, ->24
   10    19    >   INIT_FCALL                                               'strtotime'
         20        SEND_VAL                                                 'next+saturday'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $14     
         23        ASSIGN                                                   !2, $14
   12    24    >   INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'D'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $16     
         28        IS_NOT_EQUAL                                             $16, 'Fri'
         29      > JMPZ                                                     ~17, ->35
   13    30    >   INIT_FCALL                                               'strtotime'
         31        SEND_VAL                                                 'next+friday'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                         $18     
         34        ASSIGN                                                   !3, $18
   17    35    >   INIT_FCALL                                               'date'
         36        SEND_VAL                                                 'Y-m-d'
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                         $20     
         39        CONCAT                                           ~21     $20, '+-+'
         40        INIT_FCALL                                               'date'
         41        SEND_VAL                                                 'Y-m-d'
         42        SEND_VAR                                                 !3
         43        DO_ICALL                                         $22     
         44        CONCAT                                           ~23     ~21, $22
         45        ECHO                                                     ~23
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.6 ms | 1400 KiB | 17 Q