3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date_object = new DateTime('2011-04-24'); echo "Today: ".date('Y-m-d').PHP_EOL. "Yesterday: ".date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")-1, date("Y"))).PHP_EOL. "42 days ago: ".date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")-42, date("Y"))).PHP_EOL. "OP's date: ".date('Y-m-d', mktime(0, 0, 0, $date_object->format("m"), $date_object->format("d")-1, $date_object->format("Y") ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/poM2C
function name:  (null)
number of ops:  85
compiled vars:  !0 = $date_object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $1      'DateTime'
          1        SEND_VAL_EX                                              '2011-04-24'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
    4     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'Y-m-d'
          6        DO_ICALL                                         $4      
          7        CONCAT                                           ~5      'Today%3A+', $4
          8        CONCAT                                           ~6      ~5, '%0A'
    5     9        CONCAT                                           ~7      ~6, 'Yesterday%3A+'
         10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'Y-m-d'
         12        INIT_FCALL                                               'mktime'
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 0
         16        INIT_FCALL                                               'date'
         17        SEND_VAL                                                 'm'
         18        DO_ICALL                                         $8      
         19        SEND_VAR                                                 $8
         20        INIT_FCALL                                               'date'
         21        SEND_VAL                                                 'd'
         22        DO_ICALL                                         $9      
         23        SUB                                              ~10     $9, 1
         24        SEND_VAL                                                 ~10
         25        INIT_FCALL                                               'date'
         26        SEND_VAL                                                 'Y'
         27        DO_ICALL                                         $11     
         28        SEND_VAR                                                 $11
         29        DO_ICALL                                         $12     
         30        SEND_VAR                                                 $12
         31        DO_ICALL                                         $13     
         32        CONCAT                                           ~14     ~7, $13
         33        CONCAT                                           ~15     ~14, '%0A'
    6    34        CONCAT                                           ~16     ~15, '42+days+ago%3A+'
         35        INIT_FCALL                                               'date'
         36        SEND_VAL                                                 'Y-m-d'
         37        INIT_FCALL                                               'mktime'
         38        SEND_VAL                                                 0
         39        SEND_VAL                                                 0
         40        SEND_VAL                                                 0
         41        INIT_FCALL                                               'date'
         42        SEND_VAL                                                 'm'
         43        DO_ICALL                                         $17     
         44        SEND_VAR                                                 $17
         45        INIT_FCALL                                               'date'
         46        SEND_VAL                                                 'd'
         47        DO_ICALL                                         $18     
         48        SUB                                              ~19     $18, 42
         49        SEND_VAL                                                 ~19
         50        INIT_FCALL                                               'date'
         51        SEND_VAL                                                 'Y'
         52        DO_ICALL                                         $20     
         53        SEND_VAR                                                 $20
         54        DO_ICALL                                         $21     
         55        SEND_VAR                                                 $21
         56        DO_ICALL                                         $22     
         57        CONCAT                                           ~23     ~16, $22
         58        CONCAT                                           ~24     ~23, '%0A'
    7    59        CONCAT                                           ~25     ~24, 'OP%27s+date%3A+'
         60        INIT_FCALL                                               'date'
         61        SEND_VAL                                                 'Y-m-d'
         62        INIT_FCALL                                               'mktime'
         63        SEND_VAL                                                 0
         64        SEND_VAL                                                 0
         65        SEND_VAL                                                 0
    8    66        INIT_METHOD_CALL                                         !0, 'format'
         67        SEND_VAL_EX                                              'm'
         68        DO_FCALL                                      0  $26     
         69        SEND_VAR                                                 $26
    9    70        INIT_METHOD_CALL                                         !0, 'format'
         71        SEND_VAL_EX                                              'd'
         72        DO_FCALL                                      0  $27     
         73        SUB                                              ~28     $27, 1
         74        SEND_VAL                                                 ~28
   10    75        INIT_METHOD_CALL                                         !0, 'format'
         76        SEND_VAL_EX                                              'Y'
         77        DO_FCALL                                      0  $29     
         78        SEND_VAR                                                 $29
    7    79        DO_ICALL                                         $30     
   10    80        SEND_VAR                                                 $30
    7    81        DO_ICALL                                         $31     
   10    82        CONCAT                                           ~32     ~25, $31
         83        ECHO                                                     ~32
   12    84      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.66 ms | 1451 KiB | 15 Q