Req #53081 [Com]: why you should bring back abstract static methods
From: giorgio dot liscio at email dot it Date: Sat, 16 Oct 2010 06:55:31 +0000 Subject: Req #53081 [Com]: why you should bring back abstract static methods References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-155235@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53081&edit=1
ID: 53081
Comment by: giorgio dot liscio at email dot it
Reported by: giorgio dot liscio at email dot it
Summary: why you should bring back abstract static methods
Status: Bogus
Type: Feature/Change Request
Package: Class/Object related
PHP Version: 5.3.3
Block user comment: N
New Comment:
so this:
Dropped abstract static class functions. Due to an oversight, PHP 5.0.x
and 5.1.x allowed abstract static functions in classes. As of PHP 5.2.x,
only interfaces can have them.
is not valid no more in 5.3?
Previous Comments:
------------------------------------------------------------------------
[2010-10-16 08:48:55] rasmus@php.net
What's not allowed?
abstract class cA {
static function A(){static::B();}
abstract static function B();
}
class cB extends cA {
static function B(){echo "ok";}
}
cB::A();
This works fine. You obviously can't call self::B(), but static::B() is
fine.
------------------------------------------------------------------------
[2010-10-16 08:45:08] giorgio dot liscio at email dot it
but it is not allowed :(
------------------------------------------------------------------------
[2010-10-16 08:43:14] rasmus@php.net
Right, that is exactly how it should work.
------------------------------------------------------------------------
[2010-10-16 08:36:35] giorgio dot liscio at email dot it
i know, but:
abstract class cA
{
//static function A(){self::B();} error, undefined method
static function A(){static::B();} // good
abstract static function B();
}
class cB extends cA
{
static function B(){echo "ok";}
}
cB::A();
------------------------------------------------------------------------
[2010-10-16 08:27:01] rasmus@php.net
No, you are calling a method in an abstract class. The fundamental
characteristic
of an abstract class is that you cannot call methods in them.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=53081
--
Edit this bug report at http://bugs.php.net/bug.php?id=53081&edit=1
Thread (25 messages)
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Opn->Bgs]: why you should bring back abstract static methods
- Req #53081 [Bgs]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Bgs]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Bgs]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Bgs]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Bgs]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
- Req #53081 [Com]: why you should bring back abstract static methods
| « previous | php.bugs (#155235) | next » |
|---|