GEOSWKBReader::read() throws ParseException when reading valid EWKB data on PHP 7 #12

Closed
opened 2016-12-10 15:29:32 -08:00 by benmorel · 3 comments

When using GEOSWKBReader, readHEX() works fine, but read() throws a ParseException for valid EWKB.

Example:

// SRID=4326; POINT (1 2)
$ewkb = '0101000020e6100000000000000000f03f0000000000000040';

$reader = new GEOSWKBReader();
$reader->readHEX($ewkb); // OK
$reader->read(hex2bin($ewkb)); // ParseException: Unexpected EOF parsing WKB

This only happens on PHP 7 and 7.1; on PHP 5.6, read() works fine.

When using `GEOSWKBReader`, `readHEX()` works fine, but `read()` throws a `ParseException` for valid EWKB. Example: // SRID=4326; POINT (1 2) $ewkb = '0101000020e6100000000000000000f03f0000000000000040'; $reader = new GEOSWKBReader(); $reader->readHEX($ewkb); // OK $reader->read(hex2bin($ewkb)); // ParseException: Unexpected EOF parsing WKB This only happens on PHP 7 and 7.1; on PHP 5.6, `read()` works fine.

It looks like WKBReader tests are missing completely, would you send a PR to add them ?
See tests/003_WKTReader.phpt for an example.

It looks like WKBReader tests are missing completely, would you send a PR to add them ? See tests/003_WKTReader.phpt for an example.

No problem, I'll PR some tests as soon as I have a chance!

No problem, I'll PR some tests as soon as I have a chance!

PR opened: #14

PR opened: #14
strk closed this issue 2016-12-12 01:57:32 -08:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: geos/php-geos#12
There is no content yet.