php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58019 abstract static function related
Submitted: 2008-01-24 11:10 UTC Modified: 2009-02-16 20:20 UTC
From: jochem at iamjochem dot com Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 3.0.14 OS: Linux 2.6.14-1.1644_FC4smp i386
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jochem at iamjochem dot com
New email:
PHP Version: OS:

 

 [2008-01-24 11:10 UTC] jochem at iamjochem dot com
Description:
------------
APC does not recognise static functions defined in subclasses  of abstract classes that originally defines the function as an abstract.

I came accross this on a production machine which started acting up... I traced a different problem to likely be related to the version of APC I did have installed (namely 3.0.9) ... I upgraded APC to 3.0.16 and the above fatal error occurred ... I downgraded to APC 3.0.15 and the problem went away.

I therefore presume that this bug is a regression between 3.0.15 and 3.0.16.

I cannot garantee that the reproduce code actually causes the error as I did not have time to test it (I had to fix the server and get the site back up :-(). my actual code is more complex than this example and the classes are in seperate files.

if the reproduce code does not reproduce I will take the time to setup an environment where my original code causes the fatal error and work out a usable test case. please let me know if this is the case.

thanks and regards,

Reproduce code:
---------------
abstract class Foo 
{
    abstract static function bar();
} 

class FooEx extends Foo
{
    static function bar() { echo "hello world"; }
}

FooEx::bar()

Expected result:
----------------
that 'hello world' appears.

Actual result:
--------------
PHP Fatal error:  Cannot call abstract method Foo::bar()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-24 11:26 UTC] jochem at iamjochem dot com
further investigation saw that the problem also actually occurs in 3.0.14 and 3.0.15 - although unlike in 3.0.16 the Fatal Error only started occurring after the relevant page was requested a number of times. 

3.0.13 does not exhibit this behaviour
 [2008-01-29 20:19 UTC] shire@php.net
Sorry, I'm unable to reproduce this with the given example and the latest CVS.  Can you please verify that your repro code actually causes this error?
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 06:03:33 2021 UTC