Skip to content

Fix deprecated ord() for PHP 8.4+ - #7

Closed
web-monster wants to merge 1 commit into
longitude-one:mainfrom
web-monster:main
Closed

web-monster wants to merge 1 commit into
longitude-one:mainfrom
web-monster:main

Conversation

@web-monster

Copy link
Copy Markdown

Fix for PHP 8.4+.
Deprecated: ord(): Providing a string that is not one byte long is deprecated. Use ord($str[0]) instead

@dannyvw

dannyvw commented Mar 13, 2026

Copy link
Copy Markdown

@Alexandre-T Is it possible to merge this and create a new release?

@petski

petski commented May 4, 2026

Copy link
Copy Markdown

@Alexandre-T Friendly reminder this PR exists. Any way we can help to get this merged?

@bpacholek

Copy link
Copy Markdown

Seems that this software has been abandoned.

@Alexandre-T

Copy link
Copy Markdown
Contributor

I'm looking into this. I'd like to check the test with an empty string.

@Alexandre-T

Copy link
Copy Markdown
Contributor

As I guess it, your solution doesn't ensure backward compatibility and throws a different error in case of an empty string. I'm working on a solution that won't impact the other libraries using this one.

LongitudeOne\Geo\WKB\Tests\ReaderTest::testBad
LongitudeOne\Geo\WKB\Tests\ReaderTest::testBad with data set "readEmptyPackage" ('', ['readByteOrder'], 'LongitudeOne\Geo\WKB\Exceptio...eption', 'LongitudeOne\Geo\WKB\Reader: ...vided.')
Failed asserting that exception message 'LongitudeOne\Geo\WKB\Reader: Error number 2: Uninitialized string offset 0.' contains 'LongitudeOne\Geo\WKB\Reader: Error number 2: unpack(): Type C: not enough input values, need 1 values but only 0 were provided.'.

I'm working on a better solution

@Alexandre-T Alexandre-T mentioned this pull request Jun 24, 2026
@Alexandre-T

Copy link
Copy Markdown
Contributor

Job done with #9 ! I published a new release, the 3.0.1.

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.

5 participants