mirror of
https://github.com/php/php-src.git
synced 2026-04-25 00:48:25 +02:00
e186765a4d
Fixes GH-9470 Closes GH-9640
31 lines
713 B
PHP
31 lines
713 B
PHP
--TEST--
|
|
GH-9470: ReflectionMethod constructor should not find private parent method
|
|
--FILE--
|
|
<?php
|
|
|
|
class A
|
|
{
|
|
public function publicMethod() {}
|
|
protected function protectedMethod() {}
|
|
private function privateMethod() {}
|
|
}
|
|
class B extends A {}
|
|
|
|
echo (string) new ReflectionMethod('B', 'publicMethod');
|
|
echo (string) new ReflectionMethod('B', 'protectedMethod');
|
|
try {
|
|
echo (string) new ReflectionMethod('B', 'privateMethod');
|
|
} catch(Throwable $e){
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Method [ <user, inherits A> public method publicMethod ] {
|
|
@@ %s 5 - 5
|
|
}
|
|
Method [ <user, inherits A> protected method protectedMethod ] {
|
|
@@ %s 6 - 6
|
|
}
|
|
Method B::privateMethod() does not exist
|