View Issue Details

IDProjectCategoryView StatusLast Update
0001613XdebugUncategorizedpublic2019-08-26 12:37
ReporterSunMar Assigned Toderick  
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.6.1 
Target Version2.8.0devFixed in Version2.8.0beta2 
Summary0001613: Wrong error message for Fatal
Description

Hi,

Today when I was trying something out I stumbled upon a "Catachble fatal error" that wasn't catchable. When searching I came across:

https://bugs.php.net/bug.php?id=72948

I mentioned that fatal errors that are recoverable but not catchable incorrectly wrote to the error log identifying themsleves as "Catchable fatal error". This was fixed already back in PHP 7.1 where they would not identify themselves as "Recoverable fatal error" instead. But for me on PHP 7.2.10 it was still identifying itself as Catchable. It turns out XDebug is the culprit. When I disable the XDebug extension I correctly get the error message as "Recoverable fatal error".

It does kind of worry me that apparently XDebug modifies the error message rather than being a pass-thru just adding a stack trace to whatever error message PHP is giving.

Steps To Reproduce
  1. docker run --rm -it php:7.2-cli bash

  2. pecl install xdebug

  3. echo '<?php

echo "PHP Version: " . PHP_VERSION . "\n";

try {

$v = new DateTime();
$v = (string) $v;

} catch (Error $e) {

echo "Caught 'Catchable fatal error' with message: " . $e->getMessage();
die();

}

echo "Did not catch 'Catchable fatal error'";
' > test.php

  1. php test.php
    *** Output:
    PHP Version: 7.2.14

Recoverable fatal error: Object of class DateTime could not be converted to string in /test.php on line 8

  1. php -d zend_extension=xdebug.so test.php
    *** Output:
    PHP Version: 7.2.14

Catchable fatal error: Object of class DateTime could not be converted to string in /test.php on line 8

Call Stack:
0.0001 387480 1. {main}() /test.php:0

TagsNo tags attached.
Operating System
PHP Version7.2.10-7.2.14

Activities

SunMar

2019-01-21 00:29

reporter   ~0004819

Sorry, I didn't proofread properly before submitting, the sentence in the ticket description should read:

It mentioned that fatal errors that are recoverable but not catchable incorrectly wrote to the error log identifying themsleves as "Catchable fatal error". This was fixed already back in PHP 7.1 where they would now identify themselves as "Recoverable fatal error" instead. But for me on PHP 7.2.10 it was still identifying itself as Catchable.

derick

2019-01-22 22:03

administrator   ~0004824

I will address this issue for the first release after Xdebug 2.7.0.

derick

2019-08-03 20:11

administrator   ~0005102

Fixed in GIT

Issue History

Date Modified Username Field Change
2019-01-21 00:26 SunMar New Issue
2019-01-21 00:29 SunMar Note Added: 0004819
2019-01-22 22:03 derick Note Added: 0004824
2019-01-22 22:03 derick Status new => acknowledged
2019-01-22 22:03 derick Target Version => 2.7.0dev
2019-06-28 11:16 derick Target Version 2.7.0dev => 2.8.0dev
2019-08-03 20:11 derick Assigned To => derick
2019-08-03 20:11 derick Status acknowledged => resolved
2019-08-03 20:11 derick Resolution open => fixed
2019-08-03 20:11 derick Fixed in Version => 2.8.0dev
2019-08-03 20:11 derick Note Added: 0005102
2019-08-25 16:05 derick Status resolved => closed
2019-08-26 12:37 derick Fixed in Version 2.8.0dev => 2.8.0beta2
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized