Bug #68165 [NEW]: Loosing exception in try-throw-finally
From: alexeydsov at gmail dot com
Operating system: Ubuntu
PHP version: 5.5.17
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Loosing exception in try-throw-finally
Description:
------------
If you throw Exception in try block and in finally block you throw and
catch another exception than you loose first exception outside the
try/catch/finally block. This bug work in 5.5.17, not work in 5.6.
Test script:
---------------
try {
try {
echo "1\n";
throw new Exception("E1");
} finally {
try {
echo "2\n";
throw new Exception("E2");
} catch (\Exception $e) {
echo "3\n";
}
}
echo "4-\n";
} catch (\Exception $e) {
echo "4+".$e->getMessage()."\n";
}
echo "5\n";
Expected result:
----------------
1
2
3
4+E1
5
Actual result:
--------------
1
2
3
5
--
Edit bug report at https://bugs.php.net/bug.php?id=68165&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68165&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68165&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68165&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68165&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68165&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68165&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68165&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68165&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68165&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68165&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68165&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68165&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68165&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68165&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68165&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68165&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68165&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68165&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68165&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68165&r=mysqlcfg
Thread (4 messages)
- alexeydsov at gmail dot com