|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-30 18:51 UTC] tony2001@php.net
[2005-04-18 17:31 UTC] jason at amp-design dot net
[2005-04-26 10:49 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 06:00:01 2025 UTC |
Description: ------------ In the 5.1.0 branch (this morning's build), there seems to be a problem with interfaces and static methods. If a method is declared as static, it raises an error. Upon removing the public static keywords from the interface, I get an error because the class implementing this interface has a different signature / declaraton from the interface, Thus meaning static members are a no-no with interfaces. This was tested on this morning's snapshot build of 5.1.0. I assume that this is a bug and not some daft change in behavoiour you want to push into the 5.1.x branch of PHP as it would break a lot of existing PHP5 code. Reproduce code: --------------- <?php interface Example { public static function sillyError(); } class ExampleImpl implements Example { public static function sillyError() { echo 'I am a silly error'; } } ExampleImpl::sillyError(); ?> Expected result: ---------------- I am a silly error Actual result: -------------- Fatal error: Access type for interface method Example::sillyError() must be omitted in /data/web/tools/iq_framework/test.php on line 4