We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
repro: https://3v4l.org/OVu3r
<?php declare(strict_types=1); class Foo { public const MAX_LARGE_LENGTH_BYTES = 1024 + 1; // 1 KiB + 1 % public const MAX_LARGE_LENGTH_BYTES2 = (int) (1024 * 1.01); } var_dump(Foo::MAX_LARGE_LENGTH_BYTES); var_dump(Foo::MAX_LARGE_LENGTH_BYTES2);
Currently + is supported, but cast is not. But all of these are operators with constant result /wo side effects where the arguments are constant.
+
The text was updated successfully, but these errors were encountered:
I think this makes sense. I'll think a bit about it and maybe provide a patch.
Sorry, something went wrong.
Implement phpGH-18261: Allow cast to be used in constant expressions
3c616f5
Implement GH-18261: Allow cast to be used in constant expressions (#1…
2f6c069
…8264)
Successfully merging a pull request may close this issue.
Description
repro: https://3v4l.org/OVu3r
Currently
+
is supported, but cast is not. But all of these are operators with constant result /wo side effects where the arguments are constant.The text was updated successfully, but these errors were encountered: