php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70995 TypeErrors generates always a message on stderr
Submitted: 2015-11-29 23:23 UTC Modified: 2015-11-30 11:45 UTC
From: richarddeloge at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.0.0RC8 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: richarddeloge at gmail dot com
New email:
PHP Version: OS:

 

 [2015-11-29 23:23 UTC] richarddeloge at gmail dot com
Description:
------------
Hi,

Since few day, each TypeError exceptions generates also an error message on the stderr output, even if the error has ben catched by a try/catch bloc or if error reporting has been disabled.

Test script:
---------------
error_reporting(0);
$a = function (string $b) {};

try {
  $a(array());
} catch (TypeError $e){
}

Actual result:
--------------
TypeError: Argument 1 passed to {closure}() must be of the type string, array given, called in Command line code on line 1 in Command line code on line 1

Call Stack:
    0.0001     377264   1. {main}() Command line code:0
    0.0002     378088   2. {closure:Command line code:1-1}($b = array ()) Command line code:1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-30 02:52 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2015-11-30 02:52 UTC] laruence@php.net
are you running with xdebug or something similar?

thanks
 [2015-11-30 08:06 UTC] richarddeloge at gmail dot com
-Status: Feedback +Status: Open
 [2015-11-30 08:06 UTC] richarddeloge at gmail dot com
Hi,
I'm sorry, i forgot to disable xdebug after my tests...

I will open an issue on xdebug.

Thanks
Richard
 [2015-11-30 08:44 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2015-11-30 08:44 UTC] requinix@php.net
http://bugs.xdebug.org/view.php?id=1217

Apparently the workaround is to turn off xdebug.show_error_trace.
 [2015-11-30 11:36 UTC] richarddeloge at gmail dot com
Yes, this behavior come from new default value of this xdebug parameter.
 [2015-11-30 11:45 UTC] derick@php.net
FYI, the default has been changed to "Off" now. Fix will make it into 2.4.0RC2 (and 2.4.0).
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 13:01:32 2025 UTC