Fw: unpack()

From: Date: Thu, 25 Feb 2016 07:08:11 +0000
Subject: Fw: unpack()
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-91388@lists.php.net to get a copy of this message
________________________________ 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() Hi, I think the requested feature may be really useful. And the implementation is really simple https://gist.github.com/dstogov/edbb1efcd1e9701e75ab 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.

« previous php.internals (#91388) next »