#32427 [NEW]: Interfaces not allowed access modifiers

From: Date: Wed, 23 Mar 2005 12:27:28 +0000
Subject: #32427 [NEW]: Interfaces not allowed access modifiers
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-75748@lists.php.net to get a copy of this message
From:             jason at amp-design dot net
Operating system: Cent OS 3
PHP version:      5CVS-2005-03-23 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Interfaces not allowed access modifiers

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 bug report at http://bugs.php.net/?id=32427&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32427&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32427&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32427&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32427&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32427&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32427&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32427&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32427&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32427&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32427&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=32427&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=32427&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32427&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32427&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32427&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32427&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32427&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32427&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32427&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32427&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#75748) next »