Skip to content

Instantly share code, notes, and snippets.

@dixyes
Created September 1, 2021 07:38
Show Gist options
  • Save dixyes/1bce49ad107863100eb108d69ab9bf0a to your computer and use it in GitHub Desktop.
Save dixyes/1bce49ad107863100eb108d69ab9bf0a to your computer and use it in GitHub Desktop.
php -x
<?php
$file = explode("\n", file_get_contents(__FILE__));
\Swow\Debug\registerExtendedStatementHandler(function () use ($file) {
$bt = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1)[0];
if ($bt['file'] === __FILE__) {
echo $bt['line'] . ':' . $file[$bt['line'] - 1] . PHP_LF;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment