3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getLastDayofWeek ($strDia){ $date=new DateTime('now'); $strCriterio=$strDia.' this week'; $date->modify($strCriterio); echo $strCriterio.": ".$date->format('d/m/Y').PHP_EOL; } /*Pruebas*/ getLastDayofWeek('monday'); getLastDayofWeek('saturday'); getLastDayofWeek('sunday');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UYsNE
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'getlastdayofweek'
          1        SEND_VAL                                                 'monday'
          2        DO_FCALL                                      0          
   13     3        INIT_FCALL                                               'getlastdayofweek'
          4        SEND_VAL                                                 'saturday'
          5        DO_FCALL                                      0          
   14     6        INIT_FCALL                                               'getlastdayofweek'
          7        SEND_VAL                                                 'sunday'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function getlastdayofweek:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UYsNE
function name:  getLastDayofWeek
number of ops:  18
compiled vars:  !0 = $strDia, !1 = $date, !2 = $strCriterio
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NEW                                              $3      'DateTime'
          2        SEND_VAL_EX                                              'now'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
    5     5        CONCAT                                           ~6      !0, '+this+week'
          6        ASSIGN                                                   !2, ~6
    6     7        INIT_METHOD_CALL                                         !1, 'modify'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0          
    7    10        CONCAT                                           ~9      !2, '%3A+'
         11        INIT_METHOD_CALL                                         !1, 'format'
         12        SEND_VAL_EX                                              'd%2Fm%2FY'
         13        DO_FCALL                                      0  $10     
         14        CONCAT                                           ~11     ~9, $10
         15        CONCAT                                           ~12     ~11, '%0A'
         16        ECHO                                                     ~12
    8    17      > RETURN                                                   null

End of function getlastdayofweek

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.34 ms | 1403 KiB | 16 Q