3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dow = 2; $x = new \DateTime('midnight'); $x->setTime(12, 0); var_dump($x); var_dump($x->format('w')); //$x->setDate((int) $x->format('Y'), (int) $x->format('m'), (int) ) $y = new \DateTime("Sunday +2 days"); var_dump($y); var_dump($y->format('w'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hthEa
function name:  (null)
number of ops:  32
compiled vars:  !0 = $dow, !1 = $x, !2 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2
    5     1        NEW                                              $4      'DateTime'
          2        SEND_VAL_EX                                              'midnight'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
    6     5        INIT_METHOD_CALL                                         !1, 'setTime'
          6        SEND_VAL_EX                                              12
          7        SEND_VAL_EX                                              0
          8        DO_FCALL                                      0          
    8     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
    9    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !1, 'format'
         14        SEND_VAL_EX                                              'w'
         15        DO_FCALL                                      0  $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                                 
   13    18        NEW                                              $11     'DateTime'
         19        SEND_VAL_EX                                              'Sunday+%2B2+days'
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !2, $11
   14    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   15    25        INIT_FCALL                                               'var_dump'
         26        INIT_METHOD_CALL                                         !2, 'format'
         27        SEND_VAL_EX                                              'w'
         28        DO_FCALL                                      0  $15     
         29        SEND_VAR                                                 $15
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.1 ms | 1395 KiB | 15 Q