3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass { public function __construct(...$args) { print 'Parent: ' . count($args) . PHP_EOL; } } class ChildClass extends ParentClass { public function __construct(...$args) { parent::__construct(...$args); print 'Child: ' . count($args). PHP_EOL; } } $child = new ChildClass(1, 2, 3, new stdClass);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/csJ68
function name:  (null)
number of ops:  10
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'ChildClass'
          1        SEND_VAL_EX                                              1
          2        SEND_VAL_EX                                              2
          3        SEND_VAL_EX                                              3
          4        NEW                                              $2      'stdClass'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $2
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $1
          9      > RETURN                                                   1

Class ParentClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/csJ68
function name:  __construct
number of ops:  6
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_VARIADIC                                    !0      
    5     1        COUNT                                            ~1      !0
          2        CONCAT                                           ~2      'Parent%3A+', ~1
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
    6     5      > RETURN                                                   null

End of function __construct

End of class ParentClass.

Class ChildClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/csJ68
function name:  __construct
number of ops:  10
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV_VARIADIC                                    !0      
   11     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_UNPACK                                              !0
          3        CHECK_UNDEF_ARGS                                         
          4        DO_FCALL                                      1          
   12     5        COUNT                                            ~2      !0
          6        CONCAT                                           ~3      'Child%3A+', ~2
          7        CONCAT                                           ~4      ~3, '%0A'
          8        ECHO                                                     ~4
   13     9      > RETURN                                                   null

End of function __construct

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
132.25 ms | 1435 KiB | 13 Q