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 = new DateTimeZone(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/v5kXX
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 = 11
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/v5kXX
function name:  createFromFormat
number of ops:  21
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, ->11
    6     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
    8    11    >   NEW                                              $8      'DateTime'
         12        INIT_STATIC_METHOD_CALL                                  'createFromFormat'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !1
         15        SEND_VAR_EX                                              !2
         16        DO_FCALL                                      0  $9      
         17        SEND_VAR_NO_REF_EX                                       $9
         18        DO_FCALL                                      0          
         19      > RETURN                                                   $8
    9    20*     > RETURN                                                   null

End of function createfromformat

End of class MyDateTime.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
197.96 ms | 1400 KiB | 17 Q