I have a confusing little issue.
If I create a simple PHP file:
<?php
error_reporting (E_STRICT);
$backtrace = \debug_backtrace();
$filePath = $backtrace[1]["file"];
?>
I get no error message at all.
If I include it as part of a class :
class Xyz {
private function traceLog($message) {
$backtrace = \debug_backtrace();
$filePath = $backtrace[1]["file"];
$fileName = \end(\explode("/",$filePath));
$functionName = $backtrace[1]["function"];
$lineNumber = $backtrace[1]["line"];
$this->logger->debug(<removed to keep short>);
}
}
I get an error message:
PHP Strict Standards: Only variables should be passed by reference on line 27
Where line 27 is :
$fileName = \end(\explode("/",$filePath));
This is using PHP 5.5.27-1+deb.sury.org~precise+1