3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date_str = '2013-12-12 12:45:45'; $date = DateTime::createFromFormat( 'Y-m-d|', explode( ' ', $date_str)[0] )->format('U'); 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/kuait
function name:  (null)
number of ops:  18
compiled vars:  !0 = $date_str, !1 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '2013-12-12+12%3A45%3A45'
    6     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          2        SEND_VAL                                                 'Y-m-d%7C'
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        FETCH_DIM_R                                      ~4      $3, 0
          8        SEND_VAL                                                 ~4
          9        DO_FCALL                                      0  $5      
         10        INIT_METHOD_CALL                                         $5, 'format'
         11        SEND_VAL_EX                                              'U'
         12        DO_FCALL                                      0  $6      
         13        ASSIGN                                                   !1, $6
    7    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   12    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.96 ms | 1399 KiB | 17 Q