1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/tests/classes/visibility_003b.phpt
2020-02-03 22:52:20 +01:00

32 lines
664 B
PHP

--TEST--
ZE2 A redeclared method must have the same or higher visibility
--FILE--
<?php
class father {
function f0() {}
function f1() {}
public function f2() {}
protected function f3() {}
private function f4() {}
}
class same extends father {
// overload fn with same visibility
function f0() {}
public function f1() {}
public function f2() {}
protected function f3() {}
private function f4() {}
}
class fail extends same {
private function f3() {}
}
echo "Done\n"; // shouldn't be displayed
?>
--EXPECTF--
Fatal error: Access level to fail::f3() must be protected (as in class same) or weaker in %s on line 22