3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new DateTime('first Monday of this month'); echo $dt->format('W'); $month = "3"; $year = "2014"; echo date("m"); $beg = (int) date('W', strtotime("first monday of $year-$month")); $end = (int) date('W', strtotime("last monday of $year-$month")); print(join(', ', range($beg, $end)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X3Que
function name:  (null)
number of ops:  50
compiled vars:  !0 = $dt, !1 = $month, !2 = $year, !3 = $beg, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'DateTime'
          1        SEND_VAL_EX                                              'first+Monday+of+this+month'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    4     4        INIT_METHOD_CALL                                         !0, 'format'
          5        SEND_VAL_EX                                              'W'
          6        DO_FCALL                                      0  $8      
          7        ECHO                                                     $8
    5     8        ASSIGN                                                   !1, '3'
    6     9        ASSIGN                                                   !2, '2014'
    7    10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'm'
         12        DO_ICALL                                         $11     
         13        ECHO                                                     $11
    8    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'W'
         16        INIT_FCALL                                               'strtotime'
         17        ROPE_INIT                                     4  ~13     'first+monday+of+'
         18        ROPE_ADD                                      1  ~13     ~13, !2
         19        ROPE_ADD                                      2  ~13     ~13, '-'
         20        ROPE_END                                      3  ~12     ~13, !1
         21        SEND_VAL                                                 ~12
         22        DO_ICALL                                         $15     
         23        SEND_VAR                                                 $15
         24        DO_ICALL                                         $16     
         25        CAST                                          4  ~17     $16
         26        ASSIGN                                                   !3, ~17
    9    27        INIT_FCALL                                               'date'
         28        SEND_VAL                                                 'W'
         29        INIT_FCALL                                               'strtotime'
         30        ROPE_INIT                                     4  ~20     'last++monday+of+'
         31        ROPE_ADD                                      1  ~20     ~20, !2
         32        ROPE_ADD                                      2  ~20     ~20, '-'
         33        ROPE_END                                      3  ~19     ~20, !1
         34        SEND_VAL                                                 ~19
         35        DO_ICALL                                         $22     
         36        SEND_VAR                                                 $22
         37        DO_ICALL                                         $23     
         38        CAST                                          4  ~24     $23
         39        ASSIGN                                                   !4, ~24
   11    40        INIT_FCALL                                               'join'
         41        SEND_VAL                                                 '%2C+'
         42        INIT_FCALL                                               'range'
         43        SEND_VAR                                                 !3
         44        SEND_VAR                                                 !4
         45        DO_ICALL                                         $26     
         46        SEND_VAR                                                 $26
         47        DO_ICALL                                         $27     
         48        ECHO                                                     $27
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.26 ms | 1400 KiB | 21 Q