3v4l.org

run code in 300+ PHP versions simultaneously
<?php $yearMonth = '2017-06'; $firstDayOfThisMonth = new \DateTime($yearMonth . '-01'); var_dump($firstDayOfThisMonth->format('W')); $lastDayOfThisMonth = clone $firstDayOfThisMonth; $lastDayOfThisMonth = $lastDayOfThisMonth->modify('last day of this month'); var_dump($lastDayOfThisMonth->format('W'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m5qdF
function name:  (null)
number of ops:  25
compiled vars:  !0 = $yearMonth, !1 = $firstDayOfThisMonth, !2 = $lastDayOfThisMonth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2017-06'
    5     1        NEW                                              $4      'DateTime'
          2        CONCAT                                           ~5      !0, '-01'
          3        SEND_VAL_EX                                              ~5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
    7     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !1, 'format'
          8        SEND_VAL_EX                                              'W'
          9        DO_FCALL                                      0  $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                                 
   10    12        CLONE                                            ~10     !1
         13        ASSIGN                                                   !2, ~10
   11    14        INIT_METHOD_CALL                                         !2, 'modify'
         15        SEND_VAL_EX                                              'last+day+of+this+month'
         16        DO_FCALL                                      0  $12     
         17        ASSIGN                                                   !2, $12
   15    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !2, 'format'
         20        SEND_VAL_EX                                              'W'
         21        DO_FCALL                                      0  $14     
         22        SEND_VAR                                                 $14
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.36 ms | 1399 KiB | 15 Q