Bit-Wasp / bitcoin-php

Bitcoin implementation in PHP
The Unlicense
1.05k stars 418 forks source link

PHP8 release #879

Open afk11 opened 3 years ago

afk11 commented 3 years ago

Linking relevant issues and PR's here and any notes

afk11 commented 3 years ago

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

afk11 commented 3 years ago

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

abgit commented 3 years ago

🙏

satyr-software commented 3 years ago

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

abgit commented 3 years ago

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.

BafS commented 3 years ago

^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.

jorijn commented 2 years ago

Any update on this? Its been a while :)

BafS commented 2 years ago

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

jorijn commented 2 years ago

@BafS This is awesome! Thanks.

Aerendir commented 2 years ago

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?

BafS commented 2 years ago

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

Aerendir commented 2 years ago

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...

MatasR commented 2 years ago

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

BrianHenryIE commented 2 years ago

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/

meglio commented 1 year ago

Hey @afk11 have you abandoned it?

PavelDonskikh commented 1 year ago

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!