The problem here is that if the qrcode.php file isn't included in the global scope (for example, if it's included inside a function), then the $QR_PATTERN_POSITION_TABLE, $QR_MAX_LENGTH, $QR_RS_BLOCK_TABLE, $QR_MATH_EXP_TABLE, and $QR_MATH_LOG_TABLE variables are not in the global scope either. So trying to access them using the global keyword doesn't work. There are two possible fixes. The first would be to actually globalize them before first using them, but they don't seem to need to be in the global scope so I don't see any reason to pollute that. The other is to actually bring them into the classes that use them and make them static properties of those classes. That's what I did here.
The problem here is that if the qrcode.php file isn't included in the global scope (for example, if it's included inside a function), then the
$QR_PATTERN_POSITION_TABLE
,$QR_MAX_LENGTH
,$QR_RS_BLOCK_TABLE
,$QR_MATH_EXP_TABLE
, and$QR_MATH_LOG_TABLE
variables are not in the global scope either. So trying to access them using the global keyword doesn't work. There are two possible fixes. The first would be to actually globalize them before first using them, but they don't seem to need to be in the global scope so I don't see any reason to pollute that. The other is to actually bring them into the classes that use them and make them static properties of those classes. That's what I did here.