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') <= $firstDayOfMonth->format('N')) $order++; var_dump($input->format('l')); var_dump($order);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/a0lv3
function name:  (null)
number of ops:  37
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        INIT_METHOD_CALL                                         !1, 'format'
         22        SEND_VAL_EX                                              'N'
         23        DO_FCALL                                      0  $16     
         24        IS_SMALLER_OR_EQUAL                                      $15, $16
         25      > JMPZ                                                     ~17, ->27
    7    26    >   PRE_INC                                                  !2
    8    27    >   INIT_FCALL                                               'var_dump'
         28        INIT_METHOD_CALL                                         !0, 'format'
         29        SEND_VAL_EX                                              'l'
         30        DO_FCALL                                      0  $19     
         31        SEND_VAR                                                 $19
         32        DO_ICALL                                                 
    9    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !2
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.9 ms | 1396 KiB | 15 Q