Bug #70844 [NEW]: spl_autoload_register throws expected exception too early
| From: | mjauram at gmail dot com | Date: | Tue, 03 Nov 2015 14:47:11 +0000 |
| Subject: | Bug #70844 [NEW]: spl_autoload_register throws expected exception too early | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-196996@lists.php.net to get a copy of this message | ||
From: mjauram at gmail dot com
Operating system: Windows/Linux
PHP version: 5.5.30
Package: SPL related
Bug Type: Bug
Bug description:spl_autoload_register throws expected exception too early
Description:
------------
If loading classes dynamically inside of the finally block's try-catch
block then auto load throws previously throwed exception which is
catched.
Test script:
---------------
Full example here: https://goo.gl/08KRD2
try {
throw new \Exception('Exception');
} catch (\Exception $e) {
throw new \Exception('New Exception');
} finally {
try{
myclass2::test(); // spl_autoload_register function to load
classes
} catch (\Exception $ex) {
var_dump('this is not expected:', $ex); // this is not expected
but "New Exception" is caught here
}
}
Expected result:
----------------
New Exception is thrown not catched.
--
Edit bug report at https://bugs.php.net/bug.php?id=70844&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70844&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70844&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70844&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70844&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70844&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70844&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70844&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70844&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70844&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70844&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70844&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70844&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70844&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70844&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70844&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70844&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70844&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70844&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70844&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70844&r=mysqlcfg