Skip to content

Instantly share code, notes, and snippets.

@suzuken suzuken/e.php
Last active Sep 21, 2016

Embed
What would you like to do?
<?php
function main() {
kuke();
}
function kuke() {
hoge();
}
function hoge() {
trigger_error(format(debug_backtrace()), E_USER_DEPRECATED);
}
function format($caller) {
$r = array();
foreach ($caller as $c) {
$r []= sprintf("%s called from %s on line %s", $c['function'], $c['file'], $c['line']);
}
return implode($r, " => ");
}
main();
@suzuken

This comment has been minimized.

Copy link
Owner Author

suzuken commented Sep 21, 2016

like that

PHP Deprecated:  kuke in /private/tmp/e.php on line 2
PHP Deprecated:  kuke: in main called from /private/tmp/e.php on line 20 in /private/tmp/e.php on line 17
PHP Deprecated:  : in deprecated called from /private/tmp/e.php on line 8 in /private/tmp/e.php on line 17
@suzuken

This comment has been minimized.

Copy link
Owner Author

suzuken commented Sep 21, 2016

PHP Deprecated:  kuke: in hoge called from /private/tmp/e.php on line 5 in /private/tmp/e.php on line 26
PHP Deprecated:  : in hoge called from /private/tmp/e.php on line 5 in /private/tmp/e.php on line 22
PHP Deprecated:  : in main called from /private/tmp/e.php on line 29 in /private/tmp/e.php on line 14


@suzuken

This comment has been minimized.

Copy link
Owner Author

suzuken commented Sep 21, 2016

PHP Deprecated:  hoge called from /private/tmp/e.php on line 8
kuke called from /private/tmp/e.php on line 4
main called from /private/tmp/e.php on line 23
 in /private/tmp/e.php on line 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.