exussum12 / xxhash

a xxhash implementation in php
20 stars 6 forks source link

Fix PHP >= 7.1 #7

Closed Yurunsoft closed 3 years ago

Yurunsoft commented 3 years ago

First, thank the author very much. This package has solved a big problem for me.

I don't think the PHP version of this package should be >= 7.4, and the version before 7.4 should also be able to use exussum12\xxhash\V32.

At present, when using this package in PHP < 7.4, phpunit will also be required.

limingxinleo commented 3 years ago

@exussum12

Could you please take a look at this ?

Thanks.

exussum12 commented 3 years ago

Hi @Yurunsoft @limingxinleo

This is 7.4 due to using FFI (https://www.php.net/manual/en/class.ffi.php). (https://github.com/exussum12/xxhash/blob/master/src/Ffi/V32.php) Using composer on an appropriate php version (eg 7.,1 in your case) should get the correct version (1.0)

If you can upgrade to 7.4, FFI is much faster than native PHP

Yurunsoft commented 3 years ago

If my users use PHP 7.1/7.2/7.3, phpunit will be required due to problems with the old version of composer.json

exussum12 commented 3 years ago

What was the problem with the old version ? If I update to to "phpunit/phpunit": "^7.1|^8.0|^9.0" with a 7.1 compatible version would that solve the problem ?

Yurunsoft commented 3 years ago

https://github.com/exussum12/xxhash/compare/1.1...1.2

phpunit was moved to require dev only in version 1.2

exussum12 commented 3 years ago

Ive just tagged 1.0.1 which should correct this, can you confirm ?

https://github.com/exussum12/xxhash/compare/1.0...1.0.1

Yurunsoft commented 3 years ago

Thanks!