3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Subclass extends DateTimeImmutable { public function __construct(...$args) { parent::__construct(...$args); var_dump("construct"); } public function __clone() { var_dump("clone"); } } $foo = new Subclass('2022-05-05 12:12:13'); var_dump($foo); $foo2 = $foo->modify('+7 days'); echo get_class($foo2), "\n"; var_dump($foo2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7Gd2
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $foo2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Subclass'
          1        SEND_VAL_EX                                              '2022-05-05+12%3A12%3A13'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   16     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   17     7        INIT_METHOD_CALL                                         !0, 'modify'
          8        SEND_VAL_EX                                              '%2B7+days'
          9        DO_FCALL                                      0  $6      
         10        ASSIGN                                                   !1, $6
   18    11        GET_CLASS                                        ~8      !1
         12        ECHO                                                     ~8
         13        ECHO                                                     '%0A'
   19    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Class Subclass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7Gd2
function name:  __construct
number of ops:  9
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_VARIADIC                                    !0      
    6     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_UNPACK                                              !0
          3        CHECK_UNDEF_ARGS                                         
          4        DO_FCALL                                      1          
    7     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAL                                                 'construct'
          7        DO_ICALL                                                 
    8     8      > RETURN                                                   null

End of function __construct

Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7Gd2
function name:  __clone
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'clone'
          2        DO_ICALL                                                 
   12     3      > RETURN                                                   null

End of function __clone

End of class Subclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.5 ms | 998 KiB | 14 Q