3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = 1456034400; $firstDay = strtotime('first Sunday of '.date('M',$time).' '.date('Y', $time)); $lastDay = mktime(0,0,0,date('m',$time)+1,1,date('Y', $time)); $weekdays = array(); for ($i = $firstDay; $i < $lastDay; $i += 7*24*3600){ $weekdays[] = date('d',$i); } var_dump($weekdays);
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 = 37
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 37
Branch analysis from position: 46
Branch analysis from position: 37
filename:       /in/lQkB2
function name:  (null)
number of ops:  50
compiled vars:  !0 = $time, !1 = $firstDay, !2 = $lastDay, !3 = $weekdays, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1456034400
    4     1        INIT_FCALL                                               'strtotime'
          2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'M'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        CONCAT                                           ~7      'first+Sunday+of+', $6
          7        CONCAT                                           ~8      ~7, '+'
          8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'Y'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $9      
         12        CONCAT                                           ~10     ~8, $9
         13        SEND_VAL                                                 ~10
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !1, $11
    5    16        INIT_FCALL                                               'mktime'
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 0
         19        SEND_VAL                                                 0
         20        INIT_FCALL                                               'date'
         21        SEND_VAL                                                 'm'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $13     
         24        ADD                                              ~14     $13, 1
         25        SEND_VAL                                                 ~14
         26        SEND_VAL                                                 1
         27        INIT_FCALL                                               'date'
         28        SEND_VAL                                                 'Y'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $15     
         31        SEND_VAR                                                 $15
         32        DO_ICALL                                         $16     
         33        ASSIGN                                                   !2, $16
    7    34        ASSIGN                                                   !3, <array>
    9    35        ASSIGN                                                   !4, !1
         36      > JMP                                                      ->44
   10    37    >   INIT_FCALL                                               'date'
         38        SEND_VAL                                                 'd'
         39        SEND_VAR                                                 !4
         40        DO_ICALL                                         $21     
         41        ASSIGN_DIM                                               !3
         42        OP_DATA                                                  $21
    9    43        ASSIGN_OP                                     1          !4, 604800
         44    >   IS_SMALLER                                               !4, !2
         45      > JMPNZ                                                    ~23, ->37
   13    46    >   INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !3
         48        DO_ICALL                                                 
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.43 ms | 1400 KiB | 21 Q