3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EZBH_Datetime extends DateTime { public static function createFromFormat($format, $time, $timezone = null) { if(!$timezone) $timezone = new DateTimeZone(date_default_timezone_get()); if (version_compare(phpversion(), "5.2.17") > 0) { return parent::createFromFormat($format, $time, $timezone); } return new DateTime(date($format, strtotime($time)), $timezone); } } $test = EZBH_Datetime::createFromFormat("Y-m-d", "2015-04-20");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PL65a
function name:  (null)
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'EZBH_Datetime', 'createFromFormat'
          1        SEND_VAL                                                 'Y-m-d'
          2        SEND_VAL                                                 '2015-04-20'
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
          5      > RETURN                                                   1

Class EZBH_Datetime:
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
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/PL65a
function name:  createFromFormat
number of ops:  38
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        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    >   INIT_FCALL                                               'version_compare'
         12        INIT_FCALL                                               'phpversion'
         13        DO_ICALL                                         $8      
         14        SEND_VAR                                                 $8
         15        SEND_VAL                                                 '5.2.17'
         16        DO_ICALL                                         $9      
         17        IS_SMALLER                                               0, $9
         18      > JMPZ                                                     ~10, ->25
    8    19    >   INIT_STATIC_METHOD_CALL                                  'createFromFormat'
         20        SEND_VAR_EX                                              !0
         21        SEND_VAR_EX                                              !1
         22        SEND_VAR_EX                                              !2
         23        DO_FCALL                                      0  $11     
         24      > RETURN                                                   $11
   11    25    >   NEW                                              $12     'DateTime'
         26        INIT_FCALL                                               'date'
         27        SEND_VAR                                                 !0
         28        INIT_FCALL                                               'strtotime'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $13     
         31        SEND_VAR                                                 $13
         32        DO_ICALL                                         $14     
         33        SEND_VAR_NO_REF_EX                                       $14
         34        SEND_VAR_EX                                              !2
         35        DO_FCALL                                      0          
         36      > RETURN                                                   $12
   12    37*     > RETURN                                                   null

End of function createfromformat

End of class EZBH_Datetime.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.53 ms | 1400 KiB | 23 Q