php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59101 APC breaks class inheritance in certain situations
Submitted: 2010-03-08 13:38 UTC Modified: 2010-06-01 08:18 UTC
From: bturner at bltweb dot net Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.3.2RC3 OS: Gentoo Linux 2.6.31 x86_64
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: bturner at bltweb dot net
New email:
PHP Version: OS:

 

 [2010-03-08 13:38 UTC] bturner at bltweb dot net
Description:
------------
This bug seems to be related to #5401.  Certain class hierarchies produce a Fatal Error when loading.  I experience this error using the Swift mailing library (version 4.0.6) when creating an attachment before creating a message.

To simulate this (without the Swift library), create the following files:

Aa.php
------
<?php
class Aa extends Base
{
}


Ba.php
------
<?php
class Ba extends Bb implements Ib
{
}


Bb.php
------
<?php
class Bb extends Base
{
}


Base.php
--------
<?php
class Base implements Ia
{
}


Ia.php
------
<?php
interface Ia
{
  const LEVEL_TOP = 16;
}


Ib.php
------
<?php
interface Ib extends Ia
{
}


bug.php
-------
<?php

require_once "Ia.php";
require_once "Base.php";
require_once "Aa.php";
$a = new Aa();

require_once "Ib.php";
require_once "Bb.php";
require_once "Ba.php";
$b = new Ba();

echo "Hello World";



Finally, restart Apache (or clear your APC cache) and load bug.php.  You should see "Hello World".  Now refresh the page.  Instead of "Hello World", you should get a
Fatal error: Cannot inherit previously-inherited or override constant LEVEL_TOP from interface Ib in /var/www/localhost/htdocs/apctest/Ba.php on line 5 


I've seen this with PHP 5.3.2 and PHP 5.2.12 with APC 3.1.3p1.

BTW: The test case in #5401 works correctly for me, so while this bug seems similar, it doesn't look the same bug.

Expected result:
----------------
Hello World

Actual result:
--------------
First run:
Hello World


Second run:
Fatal error: Cannot inherit previously-inherited or override constant LEVEL_TOP from interface Ib in /var/www/localhost/htdocs/apctest/Ba.php on line 5 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-31 10:04 UTC] gopalv82 at yahoo dot com
Taking a really good look at this bug.

Thx for the good report.
 [2010-06-01 08:18 UTC] gopalv82 at yahoo dot com
fixed in SVN

http://news.php.net/php.pecl.cvs/14247

thanks for the bug report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 14:01:31 2024 UTC