Bug #54448 [Opn->Fbk]: Empty if block causes catch block to be skipped
| From: | felipe@php.net | Date: | Sat, 02 Apr 2011 15:58:12 +0000 |
| Subject: | Bug #54448 [Opn->Fbk]: Empty if block causes catch block to be skipped | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-159910@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54448&edit=1
ID: 54448
Updated by: felipe@php.net
Reported by: mgfreshour at gmail dot com
Summary: Empty if block causes catch block to be skipped
-Status: Open
+Status: Feedback
Type: Bug
Package: Compile Failure
Operating System: CentOS
PHP Version: 5.2.17
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-04-02 17:57:56] felipe@php.net
I can't reproduce this issue. Are you using any Zend extension?
------------------------------------------------------------------------
[2011-04-02 00:11:12] mgfreshour at gmail dot com
Description:
------------
The test script will result in an "PHP Fatal error: Uncaught exception
'Exception'" with output of :
Start
Commenting out the if block will result in the expected output of :
Start
Inside
Finish
It seems the empty if block is nullifying the catch blocks.
Test script:
---------------
<?php
echo "Start\n";
try {
try {
throw new Exception("I'm dead");
if (0) {
}
} catch (Exception $e) {
echo "Inside\n";
}
} catch (Exception $e) {
echo "Outside\n";
}
echo "Finish\n";
Expected result:
----------------
Start
Inside
Finish
Actual result:
--------------
Start
PHP Fatal error: Uncaught exception 'Exception'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54448&edit=1