3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class BaseClass{ protected function getName() : string{ return (new \ReflectionClass($this))->getShortName(); } public function Test(){ return $this->getName(); } } class ClassTest extends BaseClass{ } class RefTest extends BaseClass{ } foreach([new ClassTest(), new RefTest()] as $test){ echo $test->Test() . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/qnsqd
function name:  (null)
number of ops:  15
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'ClassTest'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~3      $1
          3        NEW                                              $4      'RefTest'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~3      $4
          6      > FE_RESET_R                                       $6      ~3, ->13
          7    > > FE_FETCH_R                                               $6, !0, ->13
   18     8    >   INIT_METHOD_CALL                                         !0, 'Test'
          9        DO_FCALL                                      0  $7      
         10        CONCAT                                           ~8      $7, '%0A'
         11        ECHO                                                     ~8
   17    12      > JMP                                                      ->7
         13    >   FE_FREE                                                  $6
   19    14      > RETURN                                                   1

Class BaseClass:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qnsqd
function name:  getName
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $0      'ReflectionClass'
          1        FETCH_THIS                                       $1      
          2        SEND_VAR_EX                                              $1
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getShortName'
          5        DO_FCALL                                      0  $3      
          6        VERIFY_RETURN_TYPE                                       $3
          7      > RETURN                                                   $3
    6     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function getname

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qnsqd
function name:  Test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_METHOD_CALL                                         'getName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   10     3*     > RETURN                                                   null

End of function test

End of class BaseClass.

Class ClassTest:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qnsqd
function name:  getName
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $0      'ReflectionClass'
          1        FETCH_THIS                                       $1      
          2        SEND_VAR_EX                                              $1
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getShortName'
          5        DO_FCALL                                      0  $3      
          6        VERIFY_RETURN_TYPE                                       $3
          7      > RETURN                                                   $3
    6     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function getname

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qnsqd
function name:  Test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_METHOD_CALL                                         'getName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   10     3*     > RETURN                                                   null

End of function test

End of class ClassTest.

Class RefTest:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qnsqd
function name:  getName
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $0      'ReflectionClass'
          1        FETCH_THIS                                       $1      
          2        SEND_VAR_EX                                              $1
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getShortName'
          5        DO_FCALL                                      0  $3      
          6        VERIFY_RETURN_TYPE                                       $3
          7      > RETURN                                                   $3
    6     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function getname

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qnsqd
function name:  Test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_METHOD_CALL                                         'getName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   10     3*     > RETURN                                                   null

End of function test

End of class RefTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.11 ms | 1399 KiB | 13 Q