From:             alexander dot stehlik at gmail dot com
Operating system: Ubuntu 12.10 / CentOS 6.4
PHP version:      5.4.16
Package:          Unknown/Other Function
Bug Type:         Bug
Bug description:namespaced class not found after including it in an error 
handler

Description:
------------
This bug was pretty hard to track down. I uploaded a test script to make it

clear.

These conditions need to be met to trigger the bug:

1. You use a custom error handler
2. You use namespaces
3. You use the "use" statement
4. You require a class within the error handler
5. You have a class that uses a deprecated = & new Classname() statment

Using an autoloader is no workaround because the system thinks the
namespaced 
class is available (class_exists() returns true).

Test script:
---------------
To reproduce the bug several files are needed. I uploaded a test script.
You can download it here:

https://docs.google.com/file/d/0Bz4hXLAjQnaiRlJWblNuX1psdzg/edit?usp=sharing
No Google account required for download!

Please call index.php and you will see an error:

Fatal error: Class 'namespaced_class' not found in
requireerror/deprecated_reference.php on line 42

Please have a look at the code to see how it occurs.


Expected result:
----------------
I expect the class that is found by class_exists() and included with a
"use" 
statement is accessible.

Actual result:
--------------
I get an error:
Fatal error: Class 'namespaced_class' not found in deprecated_reference.php
on 
line 31

-- 
Edit bug report at https://bugs.php.net/bug.php?id=65014&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65014&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65014&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65014&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65014&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65014&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65014&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65014&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65014&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65014&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65014&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65014&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65014&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65014&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65014&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65014&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65014&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65014&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65014&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65014&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65014&r=mysqlcfg

Reply via email to