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

Handle different PHP versions #102

Open
nkkollaw opened this issue Aug 5, 2017 · 3 comments
Open

Handle different PHP versions #102

nkkollaw opened this issue Aug 5, 2017 · 3 comments

Comments

@nkkollaw
Copy link
Owner

nkkollaw commented Aug 5, 2017

As mentioned in the README, Zubr supports PHP >= 7.0.0.

However, there are some differences between PHP 7.0, 7.1, and 7.2 that we'll have to account for.

PHP 7.1

For instance, 7.1 introduces a few functions that aren't present in 7.0: http://php.net/manual/en/migration71.new-functions.php

There are also changed functions (see http://php.net/manual/en/migration71.changed-functions.php), and finally some backward-imcompatible changes (see http://php.net/manual/en/migration71.incompatible.php).

PHP 7.2

There is no migration guide yet that I can link to, but there will be incompatibilities here as well.

Possible solutions

We could/should probably check that a function exists before calling it, and do something if it doesn't.

We could also have switch statements to account for changes between versions (?).

Opinions..?

@ddziaduch
Copy link
Contributor

I think we should look whether function is declared before declaring it's wrapper

@radmen
Copy link
Contributor

radmen commented Aug 7, 2017

I think that @ddziaduch is right - we should bother in wrapping only existing functions (eg in PHP 7.0 Zubr\session_gc() should throw an exception).

Regarding changed functions - maybe we should stick to the latest API. Eg. getopt() received in 7.1 new argument. We could simply trigger_error when someone sets $optind argument on PHP 7.0. What do you think about it?

@nkkollaw
Copy link
Owner Author

nkkollaw commented Aug 7, 2017

Yes, I think we should both check if the function exists before wrapping it, and consider changed parameters.

Although, if one called a function that didn't exist, Zubr would already trigger an error by calling it...

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