Skip to content

Support PHP 7.1-8.0 #11

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

Merged
merged 3 commits into from
Jul 14, 2020
Merged

Support PHP 7.1-8.0 #11

merged 3 commits into from
Jul 14, 2020

Conversation

GrahamCampbell
Copy link
Contributor

@GrahamCampbell GrahamCampbell commented Jul 13, 2020

Q A
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
License MIT
  • Drop PHP <7.1
  • Use hrtime to avoid negative timing when the system clock changes (which can happen quite a lot - my Macbook seems to change the system clock by a few seconds more than once an hour)
  • Add support for PHP 7.4 and 8.0
  • Move to GitHub actions for testing

Tests pass: https://github.com/GrahamCampbell/logger-plugin/runs/866077906.

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, some good cleanups 👍

and cool thing with hrtime, i was not aware that microtime is fragile.

the high resolution time module is not bundled with php according to https://www.php.net/manual/en/hrtime.installation.php

i think we should check if the hrtime function exist and fallback to microtime. otherwise this would be a breaking change & could prevent people from using all the other functionality of the logger plugin that does not care about timing.

@GrahamCampbell
Copy link
Contributor Author

GrahamCampbell commented Jul 14, 2020

the high resolution time module is not bundled with php according to https://www.php.net/manual/en/hrtime.installation.php

The hrtime function (https://www.php.net/manual/en/function.hrtime.php) is not the same as the hrtime extension (which provides an OOP timing library). The function is a core function added to PHP 7.3. If it is not available (if and only if the PHP version is less than 7.3), we fallback to the symfony polyfill I already required (line 18 composer.json). As far as I'm aware, it is not possible to compile PHP 7.3+ without the hrtime function. :)

@dbu dbu merged commit 8bda6ea into php-http:master Jul 14, 2020
@dbu
Copy link
Contributor

dbu commented Jul 14, 2020

great, thanks for the explanation. i somehow assumed the function would be part of the extension - learned something new today :-D

@GrahamCampbell GrahamCampbell deleted the php8 branch July 14, 2020 07:49
@GrahamCampbell
Copy link
Contributor Author

🎉 Thanks for your super speedy reviews. :)

@dbu
Copy link
Contributor

dbu commented Jul 14, 2020

well, thanks for all the work you put into the libraries! 👍

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

Successfully merging this pull request may close these issues.

2 participants