Это слабый, но эффективный способ, который я нашел, чтобы получить дамп стека, когда php его не дает.У меня есть это в класс под названием DebugUtil.
/**
* This is for use when you have the UBER-LAME...
* "PHP Fatal error: Maximum function nesting level of '100' reached,
* aborting! in Lame.php(1273)
* ...which just craps out leaving you without a stack trace.
* At the line in the file where it finally spazzes out add
* something like...
* DebugUtil::dumpStack('/tmp/lame');
* It will write the stack into that file every time it passes that
* point and when it eventually blows up (and probably long before) you
* will be able to see where the problem really is.
*/
public static function dumpStack($fileName)
{
$stack = "";
foreach (debug_backtrace() as $trace)
{
if (isset($trace['file']) &&
isset($trace['line']) &&
isset($trace['class']) &&
isset($trace['function']))
{
$stack .= $trace['file'] . '#' .
$trace['line'] . ':' .
$trace['class'] . '.' .
$trace['function'] . "\n";
}
}
file_put_contents($fileName, $stack);
}