php-src/tests/classes/visibility_002c.phpt

32 lines
556 B
Plaintext
Raw Normal View History

2003-02-05 23:07:24 +00:00
--TEST--
2003-08-09 14:48:47 +00:00
ZE2 A redeclared method must have the same or higher visibility
2003-02-05 23:07:24 +00:00
--FILE--
<?php
class father {
2020-02-03 21:52:20 +00:00
function f0() {}
function f1() {}
public function f2() {}
protected function f3() {}
private function f4() {}
2003-02-05 23:07:24 +00:00
}
class same extends father {
2020-02-03 21:52:20 +00:00
// overload fn with same visibility
function f0() {}
public function f1() {}
public function f2() {}
protected function f3() {}
private function f4() {}
2003-02-05 23:07:24 +00:00
}
class fail extends same {
2020-02-03 21:52:20 +00:00
function f2() {}
2003-02-05 23:07:24 +00:00
}
echo "Done\n"; // shouldn't be displayed
?>
--EXPECT--
2003-02-05 23:07:24 +00:00
Done