3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ExtendsDateTime extends DateTime { public $onConstruct; public function __construct($value, $tz = null) { parent::__construct($value, $tz); $this->onConstruct = true; } public static function createFromFormat($format, $datetime, $timezone = null) { return parent::createFromFormat($format, $datetime); } } $date = ExtendsDateTime::createFromFormat('Y-m-d', '2014-02-14'); var_dump($date instanceof ExtendsDateTime); echo "onConstruct\n"; var_dump($date->onConstruct);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LqeX2
function name:  (null)
number of ops:  15
compiled vars:  !0 = $date
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   INIT_STATIC_METHOD_CALL                                      'ExtendsDateTime', 'createFromFormat'
          1        SEND_VAL                                                     'Y-m-d'
          2        SEND_VAL                                                     '2014-02-14'
          3        DO_FCALL                                          0  $1      
          4        ASSIGN                                                       !0, $1
   15     5        INIT_FCALL                                                   'var_dump'
          6        INSTANCEOF                                           ~3      !0, 'ExtendsDateTime'
          7        SEND_VAL                                                     ~3
          8        DO_ICALL                                                     
   17     9        ECHO                                                         'onConstruct%0A'
   18    10        INIT_FCALL                                                   'var_dump'
         11        FETCH_OBJ_R                                          ~5      !0, 'onConstruct'
         12        SEND_VAL                                                     ~5
         13        DO_ICALL                                                     
         14      > RETURN                                                       1

Class ExtendsDateTime:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LqeX2
function name:  __construct
number of ops:  9
compiled vars:  !0 = $value, !1 = $tz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      null
    6     2        INIT_STATIC_METHOD_CALL                                      
          3        SEND_VAR_EX                                                  !0
          4        SEND_VAR_EX                                                  !1
          5        DO_FCALL                                          0          
    7     6        ASSIGN_OBJ                                                   'onConstruct'
          7        OP_DATA                                                      <true>
    8     8      > RETURN                                                       null

End of function __construct

Function createfromformat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LqeX2
function name:  createFromFormat
number of ops:  9
compiled vars:  !0 = $format, !1 = $datetime, !2 = $timezone
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      null
   10     3        INIT_STATIC_METHOD_CALL                                      'createFromFormat'
          4        SEND_VAR_EX                                                  !0
          5        SEND_VAR_EX                                                  !1
          6        DO_FCALL                                          0  $3      
          7      > RETURN                                                       $3
   11     8*     > RETURN                                                       null

End of function createfromformat

End of class ExtendsDateTime.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
230.03 ms | 2181 KiB | 14 Q