Skip to content

Commit

Permalink
Don't record stack traces in case of AMP_DEBUG not being set
Browse files Browse the repository at this point in the history
Fixes #217.
  • Loading branch information
kelunik committed Apr 21, 2018
1 parent c632e40 commit 8399301
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Internal/Placeholder.php
Expand Up @@ -94,7 +94,7 @@ private function resolve($value = null) {
}

\assert((function () {
$env = \getenv("AMP_DEBUG");
$env = \getenv("AMP_DEBUG") ?: "0";
if (($env !== "0" && $env !== "false") || (\defined("AMP_DEBUG") && \AMP_DEBUG)) {
$trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
\array_shift($trace); // remove current closure
Expand Down
2 changes: 1 addition & 1 deletion lib/Internal/Producer.php
Expand Up @@ -154,7 +154,7 @@ private function complete() {
}

\assert((function () {
$env = \getenv("AMP_DEBUG");
$env = \getenv("AMP_DEBUG") ?: "0";
if (($env !== "0" && $env !== "false") || (\defined("AMP_DEBUG") && \AMP_DEBUG)) {
$trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
\array_shift($trace); // remove current closure
Expand Down

0 comments on commit 8399301

Please sign in to comment.