1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/reflection/tests/gh9470.phpt
Ilija Tovilo 3433dab5f7 Revert 479e659331
There were 4 different reports of this breaking behavior. This is higher than I
expected. This bug fix may still be desirable, but should be discussed on the
list beforehand.

Closes GH-12127
2023-09-05 16:14:28 +02:00

43 lines
1.0 KiB
PHP

--TEST--
GH-9470: ReflectionMethod constructor finds 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');
echo (string) new ReflectionMethod('B', 'privateMethod');
$r = new ReflectionClass('B');
echo (string) $r->getMethod('publicMethod');
echo (string) $r->getMethod('protectedMethod');
echo (string) $r->getMethod('privateMethod');
?>
--EXPECTF--
Method [ <user, inherits A> public method publicMethod ] {
@@ %s 5 - 5
}
Method [ <user, inherits A> protected method protectedMethod ] {
@@ %s 6 - 6
}
Method [ <user, inherits A> private method privateMethod ] {
@@ %s 7 - 7
}
Method [ <user, inherits A> public method publicMethod ] {
@@ %s 5 - 5
}
Method [ <user, inherits A> protected method protectedMethod ] {
@@ %s 6 - 6
}
Method [ <user, inherits A> private method privateMethod ] {
@@ %s 7 - 7
}