mirror of
https://github.com/php/php-src.git
synced 2024-12-21 16:00:18 +08:00
24 lines
396 B
PHP
24 lines
396 B
PHP
--TEST--
|
|
Bug #76869 (Incorrect bypassing protected method accessibilty check)
|
|
--FILE--
|
|
<?php
|
|
class A {
|
|
private function f() {
|
|
return "A";
|
|
}
|
|
}
|
|
class B extends A {
|
|
protected function f() {
|
|
return "B";
|
|
}
|
|
}
|
|
$b = new B();
|
|
try {
|
|
var_dump($b->f());
|
|
} catch (Throwable $e) {
|
|
echo "Exception: ", $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Exception: Call to protected method B::f() from context ''
|