-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Cassandra\Float "is a reserved word" #3
Comments
Hi, and thanks for the report. We know about this bug, and it's been in the library for a very long time. This cannot be solved until we release v2, because this will be breaking change, and we are not ready to port our large codebase to v2 yet. PHP is case insensitive language so it treats Float class as reserved, this is why php-parser names "Float_" and any other type that matches the reserved keyword PHP-Parser Array_ . We plan V2 in the near and the next version will drop support for PHP5 and will address issues like these. For now, in our codebases we do not type it with cassandra types, we use plain php types (int, float ...) (It's sad, but this is what we must do) I will leave this issue open, if you have any further questions, please feel free to ask them. |
Thanks for your reply and for letting me know your plans I am very grateful for your work on this extension. My company had been planning on using ODBC as a replacement for the Datastax extension, until we found that it couldn't handle setting TTLs on a column. There was a mild panic before we found your PHP8 version and all was well again :) I will keep an eye out for the v2 release |
Signed-off-by: Dusan Malusev <dmalusev@nanointeractive.com>
Signed-off-by: Dusan Malusev <dmalusev@nanointeractive.com>
Signed-off-by: Dusan Malusev <dmalusev@nanointeractive.com>
I found an issue when using the Cassandra\Float class as a return type hint in PHP 8.0.9
Using the class name directly causes the following error:
Even when aliased, the compiler still throws an error, albeit a different one:
Example code
Removing the return type hint solves the problem, but shouldn't be required.
To be honest, this feels like it might be a PHP bug rather than an issue with the Cassandra extension, but it may be something that should be addressed here anyway; "float" is a reserved word and the class name may need to be changed to avoid issues in the future
As far as I can tell the only other "type" that might be an issue is Cassandra\Numeric, but that is only "soft" reserved
The text was updated successfully, but these errors were encountered: