3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDateTime extends DateTime { public static function createFromFormat($format, $time, $timezone = null) { if(!$timezone) $timezone = new DateTimeZone(date_default_timezone_get()); return new DateTime(date($format, strtotime($time)), $timezone); } } $dateTime = MyDateTime::createFromFormat('Y-m-d H:i', '2013-6-13'); var_dump($dateTime);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qE9tC
function name:  (null)
number of ops:  9
compiled vars:  !0 = $dateTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                  'MyDateTime', 'createFromFormat'
          1        SEND_VAL                                                 'Y-m-d+H%3Ai'
          2        SEND_VAL                                                 '2013-6-13'
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
   12     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class MyDateTime:
Function createfromformat:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/qE9tC
function name:  createFromFormat
number of ops:  24
compiled vars:  !0 = $format, !1 = $time, !2 = $timezone
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
    6     3        BOOL_NOT                                         ~3      !2
          4      > JMPZ                                                     ~3, ->11
          5    >   NEW                                              $4      'DateTimeZone'
          6        INIT_FCALL                                               'date_default_timezone_get'
          7        DO_ICALL                                         $5      
          8        SEND_VAR_NO_REF_EX                                       $5
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $4
    7    11    >   NEW                                              $8      'DateTime'
         12        INIT_FCALL                                               'date'
         13        SEND_VAR                                                 !0
         14        INIT_FCALL                                               'strtotime'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                         $10     
         19        SEND_VAR_NO_REF_EX                                       $10
         20        SEND_VAR_EX                                              !2
         21        DO_FCALL                                      0          
         22      > RETURN                                                   $8
    8    23*     > RETURN                                                   null

End of function createfromformat

End of class MyDateTime.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.1 ms | 1396 KiB | 21 Q