-1

what does the following codeline do?

$this->wordData[$wordCount] = ((@$this->wordData[$wordCount] << $remainingBit) | ($bufferVal >> $bufferBit));

It's a snippet of qrcode of mpdf (line 444). since PHP 8 it throws PHP Warning: Undefined array key 43 for example. I know @ is PHP error-suppression, but since PHP 8 it is working another way as it does before PHP 8. The part after the "=" --> ((variable << variable) | variable) is that a kind of if than (with | for OR)? I'm confused ;-)

I am teaching myself PHP and would therefore be glad if someone could help me with an explanation for beginners.

Thanks

Andreas

ab-oc
  • 39
  • 1
  • 1
  • 5

1 Answers1

-2

There have been some changes in error suppression in PHP8 - see https://php.watch/versions/8.0/fatal-error-suppression

Note that the << and >> are bitwise operators to shift the bits of a number left or right, respectively. See https://www.php.net/manual/en/language.operators.bitwise.php

Rob Eyre
  • 717
  • 7