3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDateTime extends \DateTime { public static function createFromFormat($format, $time, $timezone = null) { if (null === $timezone) { $timezone = date_default_timezone_get(); } return new DateTime(parent::createFromFormat($format, $time, $timezone)); } } var_Dump(MyDateTime::createFromFormat('yy-mm-dd', '2017-01-17', new DateTimeZone('Europe/Berlin'))->format('c')); var_Dump(MyDateTime::createFromFormat('yy-mm-dd', '2017-01-17')->format('c'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pMrhY
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'MyDateTime', 'createFromFormat'
          2        SEND_VAL                                                 'yy-mm-dd'
          3        SEND_VAL                                                 '2017-01-17'
          4        NEW                                              $0      'DateTimeZone'
          5        SEND_VAL_EX                                              'Europe%2FBerlin'
          6        DO_FCALL                                      0          
          7        SEND_VAR                                                 $0
          8        DO_FCALL                                      0  $2      
          9        INIT_METHOD_CALL                                         $2, 'format'
         10        SEND_VAL_EX                                              'c'
         11        DO_FCALL                                      0  $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                                 
   13    14        INIT_FCALL                                               'var_dump'
         15        INIT_STATIC_METHOD_CALL                                  'MyDateTime', 'createFromFormat'
         16        SEND_VAL                                                 'yy-mm-dd'
         17        SEND_VAL                                                 '2017-01-17'
         18        DO_FCALL                                      0  $5      
         19        INIT_METHOD_CALL                                         $5, 'format'
         20        SEND_VAL_EX                                              'c'
         21        DO_FCALL                                      0  $6      
         22        SEND_VAR                                                 $6
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Class MyDateTime:
Function createfromformat:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/pMrhY
function name:  createFromFormat
number of ops:  18
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
    5     3        TYPE_CHECK                                    2          !2
          4      > JMPZ                                                     ~3, ->8
    6     5    >   INIT_FCALL                                               'date_default_timezone_get'
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !2, $4
    8     8    >   NEW                                              $6      'DateTime'
          9        INIT_STATIC_METHOD_CALL                                  'createFromFormat'
         10        SEND_VAR_EX                                              !0
         11        SEND_VAR_EX                                              !1
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR_NO_REF_EX                                       $7
         15        DO_FCALL                                      0          
         16      > RETURN                                                   $6
    9    17*     > RETURN                                                   null

End of function createfromformat

End of class MyDateTime.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.24 ms | 1400 KiB | 17 Q