3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class ImplicitAbstractClass { private $a = 'foo'; protected $b = 'bar'; public $c = 'baz'; abstract function test(); } abstract class SimpleAbstractInheritance extends ImplicitAbstractClass { public $b = 'bar1'; public $d = 'foobar'; private $e = 'foobaz'; } // It's how PHP presents it $original = (new \ReflectionMethod(SimpleAbstractInheritance::class, 'test'))->__toString(); // And if use a parser and analyze methods from the SimpleAbstractInheritance class // then we collect methods from the parent directly like this $methods = (new \ReflectionClass(ImplicitAbstractClass::class))->getMethods(); $parsed = $methods[0]->__toString(); // Pay an attention to the "inherits ImplicitAbstractClass" section echo "Original: ", $original, PHP_EOL, "Parsed: ", $parsed;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HOSpR
function name:  (null)
number of ops:  23
compiled vars:  !0 = $original, !1 = $methods, !2 = $parsed
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   NEW                                                  $3      'ReflectionMethod'
          1        SEND_VAL_EX                                                  'SimpleAbstractInheritance'
          2        SEND_VAL_EX                                                  'test'
          3        DO_FCALL                                          0          
          4        INIT_METHOD_CALL                                             $3, '__toString'
          5        DO_FCALL                                          0  $5      
          6        ASSIGN                                                       !0, $5
   24     7        NEW                                                  $7      'ReflectionClass'
          8        SEND_VAL_EX                                                  'ImplicitAbstractClass'
          9        DO_FCALL                                          0          
         10        INIT_METHOD_CALL                                             $7, 'getMethods'
         11        DO_FCALL                                          0  $9      
         12        ASSIGN                                                       !1, $9
   25    13        FETCH_DIM_R                                          ~11     !1, 0
         14        INIT_METHOD_CALL                                             ~11, '__toString'
         15        DO_FCALL                                          0  $12     
         16        ASSIGN                                                       !2, $12
   28    17        ECHO                                                         'Original%3A+'
         18        ECHO                                                         !0
         19        ECHO                                                         '%0A'
         20        ECHO                                                         'Parsed%3A+'
         21        ECHO                                                         !2
         22      > RETURN                                                       1

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

End of function test

End of class ImplicitAbstractClass.

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

End of function test

End of class SimpleAbstractInheritance.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.77 ms | 2166 KiB | 13 Q