3v4l.org

run code in 300+ PHP versions simultaneously
<?php function firstDayOfWeek($date) { $day = DateTime::createFromFormat('d-m-Y', $date); $day->setISODate((int)$day->format('o'), (int)$day->format('W'), 1); return $day->format('d-m-Y'); } var_dump(firstDayOfWeek('16-07-2017'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/53rCu
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'firstdayofweek'
          2        SEND_VAL                                                 '16-07-2017'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function firstdayofweek:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/53rCu
function name:  firstDayOfWeek
number of ops:  24
compiled vars:  !0 = $date, !1 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          2        SEND_VAL                                                 'd-m-Y'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !1, $2
    6     6        INIT_METHOD_CALL                                         !1, 'setISODate'
          7        INIT_METHOD_CALL                                         !1, 'format'
          8        SEND_VAL_EX                                              'o'
          9        DO_FCALL                                      0  $4      
         10        CAST                                          4  ~5      $4
         11        SEND_VAL_EX                                              ~5
         12        INIT_METHOD_CALL                                         !1, 'format'
         13        SEND_VAL_EX                                              'W'
         14        DO_FCALL                                      0  $6      
         15        CAST                                          4  ~7      $6
         16        SEND_VAL_EX                                              ~7
         17        SEND_VAL_EX                                              1
         18        DO_FCALL                                      0          
    8    19        INIT_METHOD_CALL                                         !1, 'format'
         20        SEND_VAL_EX                                              'd-m-Y'
         21        DO_FCALL                                      0  $9      
         22      > RETURN                                                   $9
    9    23*     > RETURN                                                   null

End of function firstdayofweek

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.46 ms | 1399 KiB | 16 Q