View Issue Details

IDProjectCategoryView StatusLast Update
0001191Xdebug(No Category)public2015-10-23 08:32
ReportersnichiniAssigned Toderick 
PriorityhighSeverityblockReproducibilityalways
Status resolvedResolutionno change required 
PlatformPHP7RC5OSOSXOS Version10.10.5
Product Version 
Target VersionFixed in Version 
Summary0001191: Try / Catch / Uncaught exception / Fatal Error max execution time
DescriptionWhen an exception in thrown inside a Try/Catch, the script hangs until the max execution time is reached and the script is exited.

If I disable xdebug 3.0.0 dev, the try catch works perfectly

I've tried with several type of Exception object and none works.
Steps To ReproduceCreate a php file with:
<?php

try {
    $var = 1;
    // Code that may throw an Exception or Error.
    $var->getToto();
} catch (Throwable $t) {
    // Executed only in PHP 7, will not match in PHP 5.x
    echo "php7 exception";
} catch (Exception $e) {
    // Executed only in PHP 5.x, will not be reached in PHP 7
    echo "php5.X exception";
}

And executes the script through php cli or host

You should have something like :
( ! ) Warning: Uncaught Error: Call to a member function getToto() on integer in /WORKS/WWW/testphp7.php:6 Stack trace: #0 {main} thrown in /WORKS/WWW/testphp7.php on line 6

AND
( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in /WORKS/WWW/testphp7.php on line 7

Additional Information( ! ) Error: Call to a member function getToto() on integer in /WORKS/WWW/testphp7.php on line 6
Call Stack
# Time Memory Function Location
1 0.0008 363040 {main}( ) .../testphp7.php:0
Variables in local scope (#1)
$e =
*uninitialized*
$t =
*uninitialized*
$var =
int 1

( ! ) Warning: Uncaught Error: Call to a member function getToto() on integer in /WORKS/WWW/testphp7.php:6 Stack trace: #0 {main} thrown in /WORKS/WWW/testphp7.php on line 6
Call Stack
# Time Memory Function Location
1 0.0008 363040 {main}( ) .../testphp7.php:0
Variables in local scope (#1)
$e =
*uninitialized*
$t =
*uninitialized*
$var =
int 1

( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in /WORKS/WWW/testphp7.php on line 7
Call Stack
# Time Memory Function Location
1 0.0008 363040 {main}( ) .../testphp7.php:0
Variables in local scope (#1)
$e =
*uninitialized*
$t =
*uninitialized*
$var =
int 1
TagsNo tags attached.
Operating SystemOSX
PHP Version7.0RCx

Activities

snichini

2015-10-20 09:07

reporter  

2015-10-20_11-06-34.png (125,645 bytes)
2015-10-20_11-06-34.png (125,645 bytes)

derick

2015-10-22 22:55

administrator   ~0003183

I think this is a bug in PHP 7.0RC5 itself: http://thread.gmane.org/gmane.comp.php.devel/101724

Can you try the latest PHP from Git's PHP-7.0 branch? It should be fixed there.

snichini

2015-10-23 08:29

reporter   ~0003188

It works ! I've build the latest version of php-7.0 branch and the exception is thrown without fatal error
thanks for the support !

derick

2015-10-23 08:32

administrator   ~0003191

Okay - closing this out then.

Issue History

Date Modified Username Field Change
2015-10-20 09:07 snichini New Issue
2015-10-20 09:07 snichini File Added: 2015-10-20_11-06-34.png
2015-10-22 22:55 derick Note Added: 0003183
2015-10-22 22:55 derick Assigned To => derick
2015-10-22 22:55 derick Status new => feedback
2015-10-23 08:29 snichini Note Added: 0003188
2015-10-23 08:29 snichini Status feedback => assigned
2015-10-23 08:32 derick Note Added: 0003191
2015-10-23 08:32 derick Status assigned => resolved
2015-10-23 08:32 derick Resolution open => no change required
2016-07-31 12:35 derick Category Debug client (console) => debugclient (debugging tool)
2016-07-31 12:35 derick Category debugclient (debugging tool) => (No Category)