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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.45 ms | 1400 KiB | 17 Q