3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.26 ms | 1396 KiB | 15 Q