Last active
December 31, 2015 00:29
-
-
Save ob-ivan/7907342 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_log(__METHOD__ . ':' . __LINE__); // debug | |
error_log(__METHOD__ . ':' . __LINE__ . ': message'); // debug | |
error_log(__METHOD__ . ':' . __LINE__ . ': gettype($value) = ' . gettype($value)); // debug | |
error_log(__METHOD__ . ':' . __LINE__ . ': get_class($object) = ' . get_class($object)); // debug | |
error_log(__METHOD__ . ':' . __LINE__ . ': $class is defined in ' . (new ReflectionClass($class))->getFileName()); // debug | |
error_log(__METHOD__ . ':' . __LINE__ . ': $variable = ' . var_export($variable, true)); // debug | |
error_log(__METHOD__ . ':' . __LINE__ . ': $variable = ' . print_r($variable, true)); // debug | |
error_log(__METHOD__ . ':' . __LINE__ . ': debug_backtrace = ' . print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true)); // debug | |
error_log(__METHOD__ . ':' . __LINE__ . ': debug_backtrace = ' . var_export(array_map( | |
function ($a) { return isset($a['file']) | |
? $a['file'] . ':' . $a['line'] | |
: $a['function'] | |
; | |
}, | |
debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) | |
), true)); // debug | |
for ($p = $e, $a = []; $p; $p = $p->getPrevious()) { | |
$a[] = __METHOD__ . ':' . __LINE__ . ': ' . get_class($p) . ' (' . $p->getCode() . ') "' . $p->getMessage() . '"' . "\n" . | |
$p->getFile() . ':' . $p->getLine() . "\n" . | |
$p->getTraceAsString(); | |
} | |
$m = implode("\n", $a); | |
error_log($m); // debug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment