3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); class parent_ { public function __construct(){ } public static function createNew(): static{ return new static(); } } class child extends parent_ { public function __construct(int $a){ echo $a; } } child::createNew();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cG5Am
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                      'child', 'createNew'
          1        DO_FCALL                                          0          
          2      > RETURN                                                       1

Class parent_:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cG5Am
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                       null

End of function __construct

Function createnew:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cG5Am
function name:  createNew
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                              static              $0      
          1        DO_FCALL                                          0          
          2        VERIFY_RETURN_TYPE                                           $0
          3      > RETURN                                                       $0
   11     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function createnew

End of class parent_.

Class child:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cG5Am
function name:  __construct
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
   17     1        ECHO                                                         !0
   18     2      > RETURN                                                       null

End of function __construct

Function createnew:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cG5Am
function name:  createNew
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                              static              $0      
          1        DO_FCALL                                          0          
          2        VERIFY_RETURN_TYPE                                           $0
          3      > RETURN                                                       $0
   11     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function createnew

End of class child.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
183.67 ms | 1663 KiB | 13 Q