3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "datetime: " . date('Y-m-d H:i:s') . "\n"; $date = DateTime::createFromFormat('Y-m-d H:i:s', date('ymd')); echo "datetime with offset: " . date('Y-m-d H:i:s', $date->format('U') + 32400) . "\n"; echo "date now: " . date('Y-m-d H:i:s');
based on aqpkC
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/3dK3k
function name:  (null)
number of ops:  31
compiled vars:  !0 = $date
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   INIT_FCALL                                               'date'
         1        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         2        DO_ICALL                                         $1      
         3        CONCAT                                           ~2      'datetime%3A+', $1
         4        CONCAT                                           ~3      ~2, '%0A'
         5        ECHO                                                     ~3
   3     6        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         7        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         8        INIT_FCALL                                               'date'
         9        SEND_VAL                                                 'ymd'
        10        DO_ICALL                                         $4      
        11        SEND_VAR_NO_REF                               4          $4
        12        DO_FCALL                                      0  $5      
        13        ASSIGN                                                   !0, $5
   4    14        INIT_FCALL                                               'date'
        15        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
        16        INIT_METHOD_CALL                                         !0, 'format'
        17        SEND_VAL_EX                                              'U'
        18        DO_FCALL                                      0  $7      
        19        ADD                                              ~8      $7, 32400
        20        SEND_VAL                                                 ~8
        21        DO_ICALL                                         $9      
        22        CONCAT                                           ~10     'datetime+with+offset%3A+', $9
        23        CONCAT                                           ~11     ~10, '%0A'
        24        ECHO                                                     ~11
   5    25        INIT_FCALL                                               'date'
        26        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
        27        DO_ICALL                                         $12     
        28        CONCAT                                           ~13     'date+now%3A+', $12
        29        ECHO                                                     ~13
        30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0