3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = new \DateTime('2017-07-17'); $firstDayOfMonth = new \DateTime($input->format('Y-m-01')); $order = (int)(($input->format('j') - 1) / 7) + 1; if (($input->format('N') % 7) > ($firstDayOfMonth->format('N') % 7)) $order++; var_dump($input->format('Y-m-d: ').$order.'. '.$input->format('l'));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 30
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/A0kSp
function name:  (null)
number of ops:  43
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-17'
          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                                              'j'
         13        DO_FCALL                                      0  $10     
         14        SUB                                              ~11     $10, 1
         15        DIV                                              ~12     ~11, 7
         16        CAST                                          4  ~13     ~12
         17        ADD                                              ~14     ~13, 1
         18        ASSIGN                                                   !2, ~14
    6    19        INIT_METHOD_CALL                                         !0, 'format'
         20        SEND_VAL_EX                                              'N'
         21        DO_FCALL                                      0  $16     
         22        MOD                                              ~17     $16, 7
         23        INIT_METHOD_CALL                                         !1, 'format'
         24        SEND_VAL_EX                                              'N'
         25        DO_FCALL                                      0  $18     
         26        MOD                                              ~19     $18, 7
         27        IS_SMALLER                                               ~19, ~17
         28      > JMPZ                                                     ~20, ->30
    7    29    >   PRE_INC                                                  !2
    9    30    >   INIT_FCALL                                               'var_dump'
         31        INIT_METHOD_CALL                                         !0, 'format'
         32        SEND_VAL_EX                                              'Y-m-d%3A+'
         33        DO_FCALL                                      0  $22     
         34        CONCAT                                           ~23     $22, !2
         35        CONCAT                                           ~24     ~23, '.+'
         36        INIT_METHOD_CALL                                         !0, 'format'
         37        SEND_VAL_EX                                              'l'
         38        DO_FCALL                                      0  $25     
         39        CONCAT                                           ~26     ~24, $25
         40        SEND_VAL                                                 ~26
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.02 ms | 1400 KiB | 15 Q