Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] PHP Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) #138

Open
pifeifei opened this issue Oct 22, 2022 · 1 comment

Comments

@pifeifei
Copy link

pifeifei commented Oct 22, 2022

php: 7.4.32

version: 1.0.6

PHP Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in https://github.com/khanamiryan/php-qrcode-detector-decoder/blob/1.0.6/lib/QrReader.php#L16

final class QrReader
{
	private readonly \Zxing\BinaryBitmap $bitmap;
	private readonly \Zxing\Qrcode\QRCodeReader $reader;
	private \Zxing\Result|bool|null $result = null;  // php 7.4 不支持这样的变量声明
}
@pifeifei pifeifei changed the title [bug] [bug] PHP Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) Oct 22, 2022
@GenieTim
Copy link
Contributor

Yes, 1.0.6 was removed from GitHub for this reason (the PHP 8.1 version was not required in composer.json), but the maintainer did not manage to remove it from composer. Just downgrade to 1.0.5.2.

P.S.: PHP 7.4 will not have any support anymore in ca. 3 days. I suggest you upgrade asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants