#41129 [Bgs]: Static interface function cannot contain body
| From: | tony2001@php.net | Date: | Wed, 18 Apr 2007 12:42:11 +0000 |
| Subject: | #41129 [Bgs]: Static interface function cannot contain body | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-111647@lists.php.net to get a copy of this message | ||
ID: 41129
Updated by: tony2001@php.net
Reported By: sander at snapworks dot nl
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: linux 2.6.20-1.2944.fc6
PHP Version: 5.2.2RC1
New Comment:
>I understand this is not a bug, but merely a language construct not
>being supported.
It is not supported because it violates the nature of interfaces.
Use Google to learn why is it unsupported in other languages.
>However, where would be the place to report such
>suggestions, preferably a place where active PHP developers linger?
You're speaking to one.
Previous Comments:
------------------------------------------------------------------------
[2007-04-18 12:26:30] sander at snapworks dot nl
I understand this is not a bug, but merely a language construct not
being supported. However, where would be the place to report such
suggestions, preferably a place where active PHP developers linger?
------------------------------------------------------------------------
[2007-04-18 12:15:17] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2007-04-18 12:14:20] sander at snapworks dot nl
- more descriptive summary
------------------------------------------------------------------------
[2007-04-18 12:10:20] sander at snapworks dot nl
Description:
------------
PHP doesn't allow static methods in interfaces to have a body.
Reproduce code:
---------------
<?php
interface SomeInterface {
static public function doSomething() {
}
}
?>
Expected result:
----------------
A blank page indicating non-failure :) Static methods in interfaces
definitely should be allowed to have a body. Maybe it's not a common
practise, but it's at times convenient.
Actual result:
--------------
Fatal error: Interface function SomeInterface::doSomething() cannot
contain body in /var/www/html/workspace/test.php on line 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41129&edit=1