PHP debug recursion

19
April 16, 2019, at 11:20 AM

I have a problem when I want to add debugging for recursion to send me the backtrace to show in which file an error occured (I'm not able to debug because the code is on another server).

I tried with:

register_shutdown_function(function(){
  // here i expect this function to be called and get the trace, but not
  die('error');
});

The docs say that the error will be called but it's not.

Sample code:

error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
register_shutdown_function(function(){
    die('er');
});

function f()
{
    return f();
}
f();

Is there any other way to debug fatal errors and show backtrace for them?

READ ALSO
What is the PDO equivalent of function mysql_real_escape_string?

What is the PDO equivalent of function mysql_real_escape_string?

I am modifying my code from using mysql_* to PDOIn my code I had mysql_real_escape_string()

44
How to detect emoji in plain text with PHP Preg_Match? REGULAR [E-XX]

How to detect emoji in plain text with PHP Preg_Match? REGULAR [E-XX]

I want to change the expressions in the form [E-01] - [E-02] - [E-03] - [E-04]

24
Create/Delete Space seperated folder names

Create/Delete Space seperated folder names

When I try to create a folder whose name is seperated by spaces it only takes the first word and ignores the second oneHow do I solve this? I am writing with php to a dovecot sever

26