3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pirate { private function __construct() { } public static function construct() { $reflection = new ReflectionClass(__CLASS__); $reflection->newInstanceArgs([]); } } class Car extends Pirate { } var_dump(Pirate::construct());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpAjV
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'Pirate', 'construct'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

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

End of function __construct

Function construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpAjV
function name:  construct
number of ops:  8
compiled vars:  !0 = $reflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'Pirate'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   13     4        INIT_METHOD_CALL                                         !0, 'newInstanceArgs'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
   14     7      > RETURN                                                   null

End of function construct

End of class Pirate.

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

End of function __construct

Function construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpAjV
function name:  construct
number of ops:  8
compiled vars:  !0 = $reflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'Pirate'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   13     4        INIT_METHOD_CALL                                         !0, 'newInstanceArgs'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
   14     7      > RETURN                                                   null

End of function construct

End of class Car.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.45 ms | 1400 KiB | 15 Q