3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startDate = new \DateTime(); $startDate->setDate(2014, 01, 30); $startDate->setTime(0, 0, 0); var_dump($startDate); if ((int) $startDate->format('m') > 28 ) { $startDate->setDate($startDate->format('Y'), $startDate->format('m'), 28); } var_dump($startDate); /* $nextMonth = clone $startDate; $nextMonth->modify('+ 14 days'); $nextMonth->setDate($nextMonth->format('Y'), $nextMonth->format('m'), $nextMonth->format('t')); // $nextMonth->modify('last day of the month'); var_dump($nextMonth); $startDate->add(new DateInterval(sprintf('P%dD', $startDate->format('t')))); $startDate->sub(new DateInterval('P1D')); $startDate->setTime(23, 59, 59); while ($startDate >= $nextMonth) { $startDate->sub(new DateInterval('P1D')); } var_dump($startDate); $newDate = new \DateTime(); $newDate->setDate(2014, 02, 27); $newDate->setTime(23, 59, 59); var_dump($newDate->getTimestamp() == $startDate->getTimestamp()); */
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 33
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/ZiUuR
function name:  (null)
number of ops:  37
compiled vars:  !0 = $startDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $1      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    3     3        INIT_METHOD_CALL                                         !0, 'setDate'
          4        SEND_VAL_EX                                              2014
          5        SEND_VAL_EX                                              1
          6        SEND_VAL_EX                                              30
          7        DO_FCALL                                      0          
    4     8        INIT_METHOD_CALL                                         !0, 'setTime'
          9        SEND_VAL_EX                                              0
         10        SEND_VAL_EX                                              0
         11        SEND_VAL_EX                                              0
         12        DO_FCALL                                      0          
    5    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
    6    16        INIT_METHOD_CALL                                         !0, 'format'
         17        SEND_VAL_EX                                              'm'
         18        DO_FCALL                                      0  $7      
         19        CAST                                          4  ~8      $7
         20        IS_SMALLER                                               28, ~8
         21      > JMPZ                                                     ~9, ->33
    7    22    >   INIT_METHOD_CALL                                         !0, 'setDate'
         23        INIT_METHOD_CALL                                         !0, 'format'
         24        SEND_VAL_EX                                              'Y'
         25        DO_FCALL                                      0  $10     
         26        SEND_VAR_NO_REF_EX                                       $10
         27        INIT_METHOD_CALL                                         !0, 'format'
         28        SEND_VAL_EX                                              'm'
         29        DO_FCALL                                      0  $11     
         30        SEND_VAR_NO_REF_EX                                       $11
         31        SEND_VAL_EX                                              28
         32        DO_FCALL                                      0          
    9    33    >   INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                                 
   32    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.62 ms | 1396 KiB | 15 Q