From 1b769912d1d7f1c6ed8b17de7a9aee9ba3fe92b0 Mon Sep 17 00:00:00 2001 From: Brant Messenger Date: Sun, 18 Jun 2017 18:16:17 -0500 Subject: [PATCH] =?UTF-8?q?PHP=20Versions=20less=20than=205.3.6=20throws?= =?UTF-8?q?=20undefined=20constant=20DEBUG=5FBACKTRAC=E2=80=A6=20(#986)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * PHP Versions less than 5.3.6 throws undefined constant DEBUG_BACKTRACE_IGNORE_ARGS Notice: Use of undefined constant DEBUG_BACKTRACE_IGNORE_ARGS - assumed 'DEBUG_BACKTRACE_IGNORE_ARGS' in /vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php on line 58 * Define DEBUG_BACKTRACE_IGNORE_ARGS if not defined. * Solution using PHP_VERSION_ID and not defining... ...DEBUG_BACKTRACE_IGNORE_ARGS --- src/Monolog/Processor/IntrospectionProcessor.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Monolog/Processor/IntrospectionProcessor.php b/src/Monolog/Processor/IntrospectionProcessor.php index 2691630a..2c07caed 100644 --- a/src/Monolog/Processor/IntrospectionProcessor.php +++ b/src/Monolog/Processor/IntrospectionProcessor.php @@ -55,7 +55,12 @@ class IntrospectionProcessor return $record; } - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + /* + * http://php.net/manual/en/function.debug-backtrace.php + * As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added. + * Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'. + */ + $trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS); // skip first since it's always the current method array_shift($trace);