bitcoin-php icon indicating copy to clipboard operation
bitcoin-php copied to clipboard

PHP8 release

Open afk11 opened this issue 3 years ago • 16 comments

Linking relevant issues and PR's here and any notes

  • [x] Composer 2 support
  • [x] Bump murmurhash3
  • [ ] Bump mdanter/ecc https://github.com/Bit-Wasp/bitcoin-php/pull/877
  • [x] Bump phpunit to test on new versions
  • [x] Fix phpunit deprecated features
  • [ ] Make a release of secp256k1-php that works on php8.0, supporting the newer implementation from upstream (should be v0.3)x
  • [ ] Finish bip-schnorr PR https://github.com/Bit-Wasp/bitcoin-php/pull/758 (needs updating to final spec)

afk11 avatar Apr 26 '21 13:04 afk11

https://github.com/Bit-Wasp/bitcoin-php/pull/876 for phpunit fixup PR

afk11 avatar Apr 26 '21 13:04 afk11

Merge this https://github.com/Bit-Wasp/bitcoin-php/pull/877

afk11 avatar Apr 26 '21 13:04 afk11

🙏

abgit avatar Apr 26 '21 14:04 abgit

doesn't murmurhash3 still need ^2.1 for PHP8? ^2.0 still forced PHP ^7 I think.

satyr-software avatar May 04 '21 06:05 satyr-software

doesn't murmurhash3 still need ^2.1 for PHP8? ^2.0 still forced PHP ^7 I think.

yes. v2.1.0 is the minimum murmurhash3 version for php8 support.

abgit avatar May 04 '21 09:05 abgit

^2.0 doesn't force PHP^7, 2.0 does, which is the issue with the current composer file. Would it be possible to update ? It's not a breaking change.

BafS avatar May 31 '21 16:05 BafS

Any update on this? Its been a while :)

Jorijn avatar Dec 03 '21 09:12 Jorijn

If it can help, we did fork it to make it PHP 8 compatible: https://github.com/ProtonMail/bitcoin-php

BafS avatar Dec 03 '21 10:12 BafS

@BafS This is awesome! Thanks.

Jorijn avatar Dec 03 '21 10:12 Jorijn

If it can help, we did fork it to make it PHP 8 compatible: https://github.com/ProtonMail/bitcoin-php

The composer.json doesn't seem to be update to PHP8.0. What am I missing?

Aerendir avatar Jan 05 '22 16:01 Aerendir

The composer.json doesn't seem to be update to PHP8.0. What am I missing?

Here is the commit to make it PHP 8.0 compatible: https://github.com/ProtonMail/bitcoin-php/commit/b6ec4d2b4c5fce8a7a1ee124e63c02248fa90c04#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34

BafS avatar Jan 05 '22 16:01 BafS

The composer.json doesn't seem to be update to PHP8.0. What am I missing?

Here is the commit to make it PHP 8.0 compatible: ProtonMail@b6ec4d2#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34

Thank you!

In the meantime I'm trying to simply skip the checks on the php requirement using

composer install --ignore-platform-req php

But I don't know if all works well now: I'm verifying...

Aerendir avatar Jan 13 '22 14:01 Aerendir

While using ur branch and trying to getHex() from signedTx i get this error (i think its related with PHP8 update): Fatal error: Uncaught Error: Call to undefined method SplFixedArray::rewind() in C:\xampp\htdocs\crypto_api\vendor\protonlabs\bitcoin\src\Transaction\Mutator\AbstractCollectionMutator.php:43 Stack trace: #0 C:\xampp\htdocs\crypto_api\vendor\protonlabs\bitcoin\src\Transaction\Factory\Signer.php(179): BitWasp\Bitcoin\Transaction\Mutator\AbstractCollectionMutator->rewind() #1 C:\xampp\htdocs\crypto_api\config\Btc.php(47): BitWasp\Bitcoin\Transaction\Factory\Signer->get() #2 C:\xampp\htdocs\crypto_api\api\btc\transfer_from.php(39): Btc->signTransaction(Object(BitWasp\Bitcoin\Transaction\Transaction), Object(BitWasp\Bitcoin\Crypto\EcAdapter\Impl\PhpEcc\Key\PrivateKey), '68673') #3 {main} thrown in C:\xampp\htdocs\crypto_api\vendor\protonlabs\bitcoin\src\Transaction\Mutator\AbstractCollectionMutator.php on line 43

MatasR avatar Jul 03 '22 12:07 MatasR

This explains it (I haven’t tried to fix it):

SplFixedArray is now IteratorAggregate to support nested loops.

https://markbakeruk.net/2020/11/17/under-the-radar-a-backwards-compatible-break-for-splfixedarray-in-php-8/

BrianHenryIE avatar Jul 03 '22 17:07 BrianHenryIE

Hey @afk11 have you abandoned it?

meglio avatar Mar 21 '23 23:03 meglio

If it can help, we did fork it to make it PHP 8 compatible: https://github.com/ProtonMail/bitcoin-php

Yes! it does actually help!

PavelDonskikh avatar May 11 '23 03:05 PavelDonskikh