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

HVVM and PHP7 Type Annotations #957

Open
spekary opened this issue Apr 15, 2016 · 6 comments
Open

HVVM and PHP7 Type Annotations #957

spekary opened this issue Apr 15, 2016 · 6 comments
Milestone

Comments

@spekary
Copy link
Member

spekary commented Apr 15, 2016

Feature request to add HVVM and PHP7 Annotations.

Annotations for the two are slightly different.

Work should be started at the Model generators. It will be some time before we can implement this in the rest of the core.

We will need to take a close look at type coercion. Currently, we allow things like "true" and "false" strings to be applied to a boolean and it will do the right thing. PostGres I believe accepts, or even requires true and false strings for booleans, so it relates to the database adapters too.

HVVM I think can be done in non-strict mode.

PHP7, not sure if we would use strict mode to do type checking, or non-strict mode to do type coercion on the way in.

Likely, so that both are equal, I am thinking we can implement getters and setters as type strict, and __set can then do a type coercion, and send the result to the getters and setters. You then get the best of both worlds plus backwards compatibility.

@spekary spekary added this to the 3.1 Release milestone Apr 15, 2016
@spekary
Copy link
Member Author

spekary commented Oct 26, 2016

I am thinking it may be possible to standardize on one version, like PHP5.6, and then use some kind of translator to translate to other versions. We have pretty good PHPDOC annotations now, and if we clean those up, they could be used to help with the annotation process.

@vaibhav-kaushal
Copy link
Member

I think it is great to leave the current version where it is and look for HHVM and PHP7 annotations for a future version. I think version 3.1 should aim for being PHP 5.4+ compatibility while making sure that it works with version 7 too. Only after this has been achieved, we can move forward with HHVM annotations.

@spekary
Copy link
Member Author

spekary commented Oct 26, 2016

At least until Amazon and Google support PHP 7, we should not require PHP 7. However, the annotation effort can be done as I said with a translator, something that could use the PHP Doc comments to insert the annotations.

@spekary spekary modified the milestones: 5.0, 3.1 Release Mar 19, 2017
@spekary
Copy link
Member Author

spekary commented Jul 19, 2017

For anyone listening, Google App Engine is in beta for support for PHP7. I think it therefore makes sense to migrate the codebase to support PHP7 only in version v4, or at least explore it. I am not sure the reprecussions yet of doing so. Any objections?

@matthiaz
Copy link
Contributor

matthiaz commented Jul 19, 2017 via email

@vaibhav-kaushal
Copy link
Member

vaibhav-kaushal commented Jul 28, 2017 via email

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

No branches or pull requests

3 participants