3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo date('Y-m-d', strtotime('last day of this month previous year')) . PHP_EOL; echo (new DateTime('last day of this month previous year'))->format('Y-m-d');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WrQm8
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Y-m-d'
          2        INIT_FCALL                                               'strtotime'
          3        SEND_VAL                                                 'last+day+of+this+month+previous+year'
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                         $1      
          7        CONCAT                                           ~2      $1, '%0A'
          8        ECHO                                                     ~2
    4     9        NEW                                              $3      'DateTime'
         10        SEND_VAL_EX                                              'last+day+of+this+month+previous+year'
         11        DO_FCALL                                      0          
         12        INIT_METHOD_CALL                                         $3, 'format'
         13        SEND_VAL_EX                                              'Y-m-d'
         14        DO_FCALL                                      0  $5      
         15        ECHO                                                     $5
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.23 ms | 1432 KiB | 15 Q