#32427 [Opn->Asn]: Interfaces not allowed access modifiers
| From: | tony2001@php.net | Date: | Wed, 30 Mar 2005 16:51:13 +0000 |
| Subject: | #32427 [Opn->Asn]: Interfaces not allowed access modifiers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76068@lists.php.net to get a copy of this message | ||
ID: 32427
Updated by: tony2001@php.net
Reported By: jason at amp-design dot net
-Status: Open
+Status: Assigned
Bug Type: Zend Engine 2 problem
Operating System: Cent OS 3
PHP Version: 5CVS-2005-03-23 (dev)
-Assigned To:
+Assigned To: andi
New Comment:
Assigning to Andi, as he's the author of this change:
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?php=69434a7f33b2b7d3cc6152f95b1a307f&r1=1.596&r2=1.597&ty=u
Previous Comments:
------------------------------------------------------------------------
[2005-03-23 13:27:27] jason at amp-design dot net
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32427&edit=1