3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strtDate = '2015-05-01'; $endDate = '2015-08-31'; $startDateWeekCnt = floor( date('d',strtotime($strtDate)) / 7) ; // echo $startDateWeekCnt ."\n"; $endDateWeekCnt = floor( date('d',strtotime($endDate)) / 7) ; //echo $endDateWeekCnt. "\n"; $datediff = strtotime(date('Y-m',strtotime($endDate))."-01") - strtotime(date('Y-m',strtotime($strtDate))."-01"); $totalnoOfWeek = round(floor($datediff/(60*60*24)) / 7) + $endDateWeekCnt - $startDateWeekCnt ; echo $totalnoOfWeek ."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UsmmC
function name:  (null)
number of ops:  64
compiled vars:  !0 = $strtDate, !1 = $endDate, !2 = $startDateWeekCnt, !3 = $endDateWeekCnt, !4 = $datediff, !5 = $totalnoOfWeek
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2015-05-01'
    3     1        ASSIGN                                                   !1, '2015-08-31'
    5     2        INIT_FCALL                                               'floor'
          3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'd'
          5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        SEND_VAR                                                 $8
          9        DO_ICALL                                         $9      
         10        DIV                                              ~10     $9, 7
         11        SEND_VAL                                                 ~10
         12        DO_ICALL                                         $11     
         13        ASSIGN                                                   !2, $11
    7    14        INIT_FCALL                                               'floor'
         15        INIT_FCALL                                               'date'
         16        SEND_VAL                                                 'd'
         17        INIT_FCALL                                               'strtotime'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $13     
         20        SEND_VAR                                                 $13
         21        DO_ICALL                                         $14     
         22        DIV                                              ~15     $14, 7
         23        SEND_VAL                                                 ~15
         24        DO_ICALL                                         $16     
         25        ASSIGN                                                   !3, $16
   10    26        INIT_FCALL                                               'strtotime'
         27        INIT_FCALL                                               'date'
         28        SEND_VAL                                                 'Y-m'
         29        INIT_FCALL                                               'strtotime'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $18     
         32        SEND_VAR                                                 $18
         33        DO_ICALL                                         $19     
         34        CONCAT                                           ~20     $19, '-01'
         35        SEND_VAL                                                 ~20
         36        DO_ICALL                                         $21     
         37        INIT_FCALL                                               'strtotime'
         38        INIT_FCALL                                               'date'
         39        SEND_VAL                                                 'Y-m'
         40        INIT_FCALL                                               'strtotime'
         41        SEND_VAR                                                 !0
         42        DO_ICALL                                         $22     
         43        SEND_VAR                                                 $22
         44        DO_ICALL                                         $23     
         45        CONCAT                                           ~24     $23, '-01'
         46        SEND_VAL                                                 ~24
         47        DO_ICALL                                         $25     
         48        SUB                                              ~26     $21, $25
         49        ASSIGN                                                   !4, ~26
   11    50        INIT_FCALL                                               'round'
         51        INIT_FCALL                                               'floor'
         52        DIV                                              ~28     !4, 86400
         53        SEND_VAL                                                 ~28
         54        DO_ICALL                                         $29     
         55        DIV                                              ~30     $29, 7
         56        SEND_VAL                                                 ~30
         57        DO_ICALL                                         $31     
         58        ADD                                              ~32     $31, !3
         59        SUB                                              ~33     ~32, !2
         60        ASSIGN                                                   !5, ~33
   12    61        CONCAT                                           ~35     !5, '%0A'
         62        ECHO                                                     ~35
         63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.14 ms | 1400 KiB | 21 Q