3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $privateProperty = 1; private function privateMethod() {} } class B extends A {} try { echo (string) $method = new ReflectionMethod('B', 'privateMethod'); } catch(Throwable $e){ echo (string) $e; } try { echo (string) new ReflectionProperty('B', 'privateProperty'); } catch(Throwable $e){ echo (string) $e; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Found catch point at position: 18
Branch analysis from position: 18
2 jumps found. (Code = 107) Position 1 = 19, Position 2 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bso8B
function name:  (null)
number of ops:  22
compiled vars:  !0 = $method, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'ReflectionMethod'
          1        SEND_VAL_EX                                              'B'
          2        SEND_VAL_EX                                              'privateMethod'
          3        DO_FCALL                                      0          
          4        ASSIGN                                           ~4      !0, $2
          5        CAST                                          6  ~5      ~4
          6        ECHO                                                     ~5
          7      > JMP                                                      ->11
   12     8  E > > CATCH                                       last         'Throwable'
   13     9    >   CAST                                          6  ~6      !1
         10        ECHO                                                     ~6
   16    11    >   NEW                                              $7      'ReflectionProperty'
         12        SEND_VAL_EX                                              'B'
         13        SEND_VAL_EX                                              'privateProperty'
         14        DO_FCALL                                      0          
         15        CAST                                          6  ~9      $7
         16        ECHO                                                     ~9
         17      > JMP                                                      ->21
   17    18  E > > CATCH                                       last         'Throwable'
   18    19    >   CAST                                          6  ~10     !1
         20        ECHO                                                     ~10
   19    21    > > RETURN                                                   1

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

End of function privatemethod

End of class A.

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

End of function privatemethod

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.2 ms | 1008 KiB | 13 Q