2
How to correctly suppress warnings generated by PHP in a given line of code? I tried using "@", but still the warning is generated in the log.
Excerpt from the code that is generating the Warning:
...
while ($SrcPos <= strlen($Src)-1) {
$SrcAsc = (ord($Src[$SrcPos]) + $OffSet) % 255;
$SrcAsc = @$SrcAsc ^ ord($Key[$SrcPos]); //***** Nesta Linha! (inseri o @ mas ainda assim está gerando o Aviso)
$Dest = $Dest.strtoupper(dechex($SrcAsc));
$OffSet = $SrcAsc;
$SrcPos = $SrcPos + 1;
}
...
Nginx generated Log File:
2017/11/03 16:01:01 [error] 2295#0: *382 FastCGI sent in stderr: "PHP message: PHP Notice: Uninitialized string...
PHP message: PHP Notice: Uninitialized string offset: 11 in /usr/share/nginx/www/util/functions.php on line 475
PHP message: PHP Notice: Uninitialized string offset: 12 in /usr/share/nginx/www/util/functions.php on line 475
PHP message: PHP Notice: Uninitialized string offset: 13 in /usr/share/nginx/www/util/functions.php on line 475
PHP message: PHP Notice: Uninitialized string offset: 14 in /usr/share/nginx/www/util/functions.php on line 475
PHP message: PHP Notice: Uninitialized string offset: 15 in /usr/share/nginx/www/util/functions.php on line 475...
pq not a
isset()
to handle the error?$Key[$SrcPos]
must have an invalid Index.– rray
@rray I will test and post the result.
– Carlos Andrade