Skip to content

Commit 09405d2

Browse files
authored
Updates for PHP 7.4 and greater
1 parent 7d10b3c commit 09405d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/SugarLogger/SugarLogger.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ private function extendedPrintR($data, $maxLevel = 5, $eol = PHP_EOL, $trimChars
205205
foreach ($ref->getProperties() as $property) {
206206
$property->setAccessible(true);
207207
$pType = $property->getName();
208-
$elements[$pType] = $property->getValue($data);
208+
// the @ operator is to ignore all notices in getValue:
209+
@$elements[$pType] = $property->getValue($data);
209210
}
210211
}
211212
elseif ($type === 'array') {
@@ -289,6 +290,7 @@ private function getExceptionTraceAsString($exception, $eol = false, $trimChars
289290
continue; // skip repetitive entries common to everything logged
290291
}
291292
try {
293+
// since PHP 7.4, args will only be available if php.ini includes: zend.exception_ignore_args = Off
292294
if (isset($frame['args'])) {
293295
$args = array();
294296
$argNames = $this->getArguments(isset($frame['class']) ? $frame['class'] : null, $frame['function']);

0 commit comments

Comments
 (0)