abstract static methods?

abstract static methods?

am 26.09.2007 20:07:45 von Mads Lee Jensen

Hello..
Was wondering shouldn't an abstract static method cause a E_STRICT ?

this is my test.

error_reporting(E_STRICT);
abstract class Test_Abstract
{
protected abstract static function testStatic();
}

class Child extends Test_Abstract
{
protected static function testStatic()
{
echo 'what';
}
}
$test = new Child();

or how should i read this

"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."

http://php.oregonstate.edu/manual/en/migration52.incompatibl e.php

im running 5.2.2

Re: abstract static methods?

am 26.09.2007 22:44:37 von gosha bine

Mads Lee Jensen wrote:
> Hello..
> Was wondering shouldn't an abstract static method cause a E_STRICT ?
>
> this is my test.
>
> error_reporting(E_STRICT);
> abstract class Test_Abstract
> {
> protected abstract static function testStatic();
> }
>
> class Child extends Test_Abstract
> {
> protected static function testStatic()
> {
> echo 'what';
> }
> }
> $test = new Child();
>
> or how should i read this
>
> "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."
>
> http://php.oregonstate.edu/manual/en/migration52.incompatibl e.php
>
> im running 5.2.2
>

Hmm... this has to work (i.e. raise an error) - there is a check in ZE
code, there is a test in tests/ and actually it does work on my self
compiled php, but not on the precomp 5.2.3 binary. Weird.

However, I think disabling abstract statics was a rather stupid action
and they definitely will be back soon, because late binding for statics
is already on the way.

--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok

Re: abstract static methods?

am 28.09.2007 01:01:40 von Steve

"gosha bine" wrote in message
news:fdegdl$mf$1@registered.motzarella.org...
> Mads Lee Jensen wrote:
>> Hello..
>> Was wondering shouldn't an abstract static method cause a E_STRICT ?
>>
>> this is my test.
>>
>> error_reporting(E_STRICT);
>> abstract class Test_Abstract
>> {
>> protected abstract static function testStatic();
>> }
>>
>> class Child extends Test_Abstract
>> {
>> protected static function testStatic()
>> {
>> echo 'what';
>> }
>> }
>> $test = new Child();
>>
>> or how should i read this
>>
>> "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."
>>
>> http://php.oregonstate.edu/manual/en/migration52.incompatibl e.php
>>
>> im running 5.2.2
>>
>
> Hmm... this has to work (i.e. raise an error) - there is a check in ZE
> code, there is a test in tests/ and actually it does work on my self
> compiled php, but not on the precomp 5.2.3 binary. Weird.
>
> However, I think disabling abstract statics was a rather stupid action

why is that?