3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i = 1; $i <= 30; $i++) { $input = new \DateTime('2017-07-'.$i); $firstDayOfMonth = new \DateTime($input->format('Y-m-01')); $order = (int)($input->format('n') / 7) + 1; if (($input->format('N') % 7) <= ($firstDayOfMonth->format('N') % 7)) $order++; var_dump($order.' '.$input->format('l')); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 2
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 2
Branch analysis from position: 43
Branch analysis from position: 2
Branch analysis from position: 32
filename:       /in/oDZSs
function name:  (null)
number of ops:  44
compiled vars:  !0 = $i, !1 = $input, !2 = $firstDayOfMonth, !3 = $order
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->41
    4     2    >   NEW                                              $5      'DateTime'
          3        CONCAT                                           ~6      '2017-07-', !0
          4        SEND_VAL_EX                                              ~6
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
    5     7        NEW                                              $9      'DateTime'
          8        INIT_METHOD_CALL                                         !1, 'format'
          9        SEND_VAL_EX                                              'Y-m-01'
         10        DO_FCALL                                      0  $10     
         11        SEND_VAR_NO_REF_EX                                       $10
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $9
    6    14        INIT_METHOD_CALL                                         !1, 'format'
         15        SEND_VAL_EX                                              'n'
         16        DO_FCALL                                      0  $13     
         17        DIV                                              ~14     $13, 7
         18        CAST                                          4  ~15     ~14
         19        ADD                                              ~16     ~15, 1
         20        ASSIGN                                                   !3, ~16
    7    21        INIT_METHOD_CALL                                         !1, 'format'
         22        SEND_VAL_EX                                              'N'
         23        DO_FCALL                                      0  $18     
         24        MOD                                              ~19     $18, 7
         25        INIT_METHOD_CALL                                         !2, 'format'
         26        SEND_VAL_EX                                              'N'
         27        DO_FCALL                                      0  $20     
         28        MOD                                              ~21     $20, 7
         29        IS_SMALLER_OR_EQUAL                                      ~19, ~21
         30      > JMPZ                                                     ~22, ->32
    8    31    >   PRE_INC                                                  !3
    9    32    >   INIT_FCALL                                               'var_dump'
         33        CONCAT                                           ~24     !3, '++'
         34        INIT_METHOD_CALL                                         !1, 'format'
         35        SEND_VAL_EX                                              'l'
         36        DO_FCALL                                      0  $25     
         37        CONCAT                                           ~26     ~24, $25
         38        SEND_VAL                                                 ~26
         39        DO_ICALL                                                 
    3    40        PRE_INC                                                  !0
         41    >   IS_SMALLER_OR_EQUAL                                      !0, 30
         42      > JMPNZ                                                    ~29, ->2
   10    43    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.78 ms | 1392 KiB | 15 Q