Edit report at http://bugs.php.net/bug.php?id=54448&edit=1

 ID:                 54448
 Updated by:         fel...@php.net
 Reported by:        mgfreshour at gmail dot com
 Summary:            Empty if block causes catch block to be skipped
 Status:             Open
 Type:               Bug
 Package:            Compile Failure
 Operating System:   CentOS
 PHP Version:        5.2.17
 Block user comment: N
 Private report:     N

 New Comment:

I can't reproduce this issue. Are you using any Zend extension?


Previous Comments:
------------------------------------------------------------------------
[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

Reply via email to