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"; $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 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 38
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 38
Branch analysis from position: 42
Branch analysis from position: 38
filename:       /in/BnZs3
function name:  (null)
number of ops:  43
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'
    8    10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'W'
         12        INIT_FCALL                                               'strtotime'
         13        ROPE_INIT                                     4  ~13     'first+monday+of+'
         14        ROPE_ADD                                      1  ~13     ~13, !2
         15        ROPE_ADD                                      2  ~13     ~13, '-'
         16        ROPE_END                                      3  ~12     ~13, !1
         17        SEND_VAL                                                 ~12
         18        DO_ICALL                                         $15     
         19        SEND_VAR                                                 $15
         20        DO_ICALL                                         $16     
         21        CAST                                          4  ~17     $16
         22        ASSIGN                                                   !3, ~17
    9    23        INIT_FCALL                                               'date'
         24        SEND_VAL                                                 'W'
         25        INIT_FCALL                                               'strtotime'
         26        ROPE_INIT                                     4  ~20     'last++monday+of+'
         27        ROPE_ADD                                      1  ~20     ~20, !2
         28        ROPE_ADD                                      2  ~20     ~20, '-'
         29        ROPE_END                                      3  ~19     ~20, !1
         30        SEND_VAL                                                 ~19
         31        DO_ICALL                                         $22     
         32        SEND_VAR                                                 $22
         33        DO_ICALL                                         $23     
         34        CAST                                          4  ~24     $23
         35        ASSIGN                                                   !4, ~24
   11    36        ASSIGN                                                   !5, !3
         37      > JMP                                                      ->40
         38    >   ECHO                                                     !5
         39        PRE_INC                                                  !5
         40    >   IS_SMALLER_OR_EQUAL                                      !5, !4
         41      > JMPNZ                                                    ~28, ->38
         42    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.89 ms | 1400 KiB | 17 Q