3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date_str = '2013-12-12'; $date = DateTime::createFromFormat( 'Y-m-d|', $date_str ); print_r($date); print_r($date->format('U')); //$ts = DateTime::createFromFormat( 'U', $date_str->format('Y-m-d') ); //print_r( $ts->format('U'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z2Jhu
function name:  (null)
number of ops:  16
compiled vars:  !0 = $date_str, !1 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '2013-12-12'
    6     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          2        SEND_VAL                                                 'Y-m-d%7C'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !1, $3
    7     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    8     9        INIT_FCALL                                               'print_r'
         10        INIT_METHOD_CALL                                         !1, 'format'
         11        SEND_VAL_EX                                              'U'
         12        DO_FCALL                                      0  $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                                 
   12    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.63 ms | 1394 KiB | 15 Q