php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60149 SPL autoloader not called in error handler triggered by private __call
Submitted: 2011-10-27 15:18 UTC Modified: 2013-09-18 07:56 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: gedrox at gmail dot com Assigned:
Status: Not a bug Package: SPL related
PHP Version: 5.3.8 OS: Ubuntu 11.10
Private report: No CVE-ID: None
 [2011-10-27 15:18 UTC] gedrox at gmail dot com
Description:
------------
No SPL registered autoloader is called inside custom error handler if it has been 
triggered by private __call() magic function what should be public instead.

Test script:
---------------
http://gedrox.eu/php_spl_autoloader_error_handler_private_call.tar

Run run.php file.

Expected result:
----------------
Tried to load class 'DoesNotExist_1'
Caught error 'The magic method __call() must have public visibility and cannot be 
static'
Tried to load class 'DoesNotExist_2'
Done

Actual result:
--------------
Tried to load class 'DoesNotExist_1'
Caught error 'The magic method __call() must have public visibility and cannot 
be static'

Fatal error: Uncaught exception 'RuntimeException' with message 'Assertion 
failed on line '66' in LoaderTest.php on line 45

RuntimeException: Assertion failed on line '66'
 in LoaderTest.php on line 45

Call Stack:
    0.0001     635080   1. {main}() run.php:0
    0.0003     665536   2. LoaderTest->testFailure() run.php:6
    0.0004     670584   3. assert() LoaderTest.php:66
    0.0004     671144   4. LoaderTest->assertionFail() LoaderTest.php:0


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-26 09:30 UTC] phil at propcom dot co dot uk
This is similar to https://bugs.php.net/bug.php?id=54054. The two may be related.
 [2013-09-18 07:56 UTC] tony2001@php.net
-Status: Open +Status: Not a bug
 [2013-09-18 07:56 UTC] tony2001@php.net
This is by design, autoload cannot be triggered from compiler.
See my explanation in bug 54054.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC