php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56661 APC causes problems with included PEAR packages/classes
Submitted: 2005-11-18 12:11 UTC Modified: 2005-11-18 12:14 UTC
From: ramsey@php.net Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5_1 CVS-2005-11-18 (dev) OS: Debian sarge
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ramsey@php.net
New email:
PHP Version: OS:

 

 [2005-11-18 12:11 UTC] ramsey@php.net
Description:
------------
I think this bug is related to http://pecl.php.net/bugs/bug.php?id=5875 but I have auto_globals_jit set to Off, so I don't think that's affecting the behavior of APC in this instance.

When using PEAR::Text_Highlighter, it works fine on the first load of the page, but on subsequent loads, it fails with many warnings about recursive inheritance and ends with a fatal error about redeclaring a class. When APC is not enabled, this does not occur.

Reproduce code:
---------------
http://manwe.kratzology.com:8080/~ramsey/highlight.phps

In a nutshell, it's this (but the code above shows the CSS that provides the highlighting):

<?php
require_once 'Text/Highlighter.php';
require_once 'Text/Highlighter/Renderer/Html.php';
$options = array(
    'numbers' => 0,
    'tabsize' => 4,
);
$renderer =& new Text_Highlighter_Renderer_HTML($options);
$hl =& Text_Highlighter::factory('php');
$hl->setRenderer($renderer);
$html = $hl->highlight(file_get_contents('filter.php'));

echo $html;
?>

Expected result:
----------------
Should generate highlighted text with PEAR::Text_Highlighter without generating a Fatal error.

See here (where APC is not enabled):
http://manwe.kratzology.com/~ramsey/highlight.php

Actual result:
--------------
Warning: Recursive inheritance called for Text_Highlighter in /data/home/ramsey/public_html/highlight.php on line 39

Warning: Added class text_highlighter in /data/home/ramsey/public_html/highlight.php on line 39

Warning: Recursive inheritance called for PEAR in /data/home/ramsey/php/5/lib/php/Text/Highlighter.php on line 23

Warning: Added class pear in /data/home/ramsey/php/5/lib/php/Text/Highlighter.php on line 23

Warning: Recursive inheritance called for PEAR_Error in /data/home/ramsey/php/5/lib/php/Text/Highlighter.php on line 23

Warning: Added class pear_error in /data/home/ramsey/php/5/lib/php/Text/Highlighter.php on line 23

Warning: Recursive inheritance called for Text_Highlighter_Renderer_Html in /data/home/ramsey/public_html/highlight.php on line 40

Warning: Added class text_highlighter_renderer_html in /data/home/ramsey/public_html/highlight.php on line 40

Warning: Recursive inheritance called for Text_Highlighter_Renderer in /data/home/ramsey/php/5/lib/php/Text/Highlighter/Renderer/Html.php on line 27

Warning: Added class text_highlighter_renderer in /data/home/ramsey/php/5/lib/php/Text/Highlighter/Renderer/Html.php on line 27

Fatal error: Cannot redeclare class text_highlighter_renderer_html in /data/home/ramsey/php/5/lib/php/Text/Highlighter/Renderer/Html.php on line 64

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-18 12:14 UTC] rasmus@php.net
The CVS version is not in a runnable state right now.  Stick with 3.0.8.  Give us a few days.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 06:01:28 2024 UTC