php-src/Zend/tests/bug76869.phpt

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 ''