php-src/tests/classes/interface_method_private.phpt
Ayesh Karunaratne a706d7302a Improve interface non-public method error message
Currently interface methods with visibility `private` or `protected` fail
with an error message:

  Access type for interface method A::b() must be omitted

However, explicitly setting visibility `public` is allowed and often desired.
This commit updates the error message to:

  Access type for interface method A::b() must be public
2021-06-02 20:08:36 +01:00

13 lines
229 B
PHP

--TEST--
ZE2 An interface method cannot be private
--FILE--
<?php
interface if_a {
abstract private function err();
}
?>
--EXPECTF--
Fatal error: Access type for interface method if_a::err() must be public in %s on line %d