Hi Dmitry,

Yes, this is an API change, and therefore needs an RFC, even if it may look
like an obvious/simple change.

Functional tests for the new parameter are also needed.


On Feb 25, 2016 02:08, "Dmitry Stogov" wrote:

From: Dmitry Stogov
Sent: Wednesday, February 24, 2016 13:35
To: Hynek Bartoš; php-dev@lists.php.net; php-general-help@lists.php.net
Subject: Re: unpack()


I think the requested feature may be really useful.

And the implementation is really simple

I think, committing this into master doesn't require RFC and voting.

Anyone objects?

Thanks. Dmitry.

From: Hynek Bartoš <hbartos@gmail.com>
Sent: Wednesday, February 24, 2016 01:59
To: php-dev@lists.php.net; php-general-help@lists.php.net
Subject: unpack()

Dear PHP developers,
Over more than 10 years, I'm missing optional 3rd argument,
an $offset argument, in function unpack():

array unpack (string $format, string $data, int $offset = 0)

The reason is very simple... Every time I need to use this
function to convert some binary data I must seek to correct
place, usually by cutting some piece with substr() function.
Sometimes I don't know how many bytes ASCII-Z strings will
consume, so I must cut larger strings which waste resources
like CPU time and memory...

During first five years I hoped that at least every second
user of this function will need the same feature and some
improvement will be very soon available. But as time passed
I decide to write you some notes.

I don't know which discussion group was it and as I checked
my email, no responses indicating any comments was found
since 2009 when I posted my suggestions. :-(

Because I'm not in any mail group, Twitter, IRC nor other
talk space any more, I'm writing you to published addresses
with hope you would forward it to the right place...

I'm confident that this improvement is very simple update
in the C code and will save lots of troubles to many people
which are using this cool function.

Best regards, Hynek Bartos, Europe, Prague.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 18 | next ›
Discussion Overview
groupphp-internals @
postedFeb 25, '16 at 7:08a
activeMar 2, '16 at 12:59p



site design / logo © 2019 Grokbase