Re: New hexdump manipulation functions for PHP5

php.internals

Alexander Demin

19 years ago
On Mon Dec 25 09:46:13 2006, Antony Dovgal wrote:
>> this patch for PHP5 adds four new string functions into the extension >> 'standard': >> - hexdump() >> - packhex() >> - smart_hexdump() >> - smart_packhex()
>Please elaborate on how these functions can be useful, why in your
opinion they should be added
>to the core (and not PECL) and why this cannot be implemented in PHP itself.
I think, hexdump manipulation functions are very useful string functions. I have been using hexdump(), packhex() and smart hex functions, written on PHP, and including it in many projects more than 2 years, and at last I've implemented it into php core. It helps in debugging: - communication protocols - any algorithms with binary data - any kind of logging etc why to the core? because pack() function is already in the core. It's good function, but it's a little bit complex for every minute using. hexdump manipulation is like md5, crc32 etc. It is every minute function, I think.
-- Regards, Alexander Demin

Antony Dovgal

19 years ago
On 12/25/2006 06:07 PM, Alexander Demin wrote:
> On Mon Dec 25 09:46:13 2006, Antony Dovgal wrote: > >>> this patch for PHP5 adds four new string functions into the extension >>> 'standard': >>> - hexdump() >>> - packhex() >>> - smart_hexdump() >>> - smart_packhex() > >>Please elaborate on how these functions can be useful, why in your > opinion they should be added >>to the core (and not PECL) and why this cannot be implemented in PHP itself. > > I think, hexdump manipulation functions are very useful string functions. > I have been using hexdump(), packhex() and smart hex functions, > written on PHP, and including it in many projects more than 2 years, > and at last I've implemented it into php core.
Well, what about PEAR package then? I don't see any certain reasons to add them into the core, if they can be easily implemented in PHP. While I can understand your needs, I'm against adding to the core each & every function that can be useful for a couple of persons using PHP, especially if this function can be implemented in PHP. So -1 from me.
-- Wbr, Antony Dovgal

Stanislav Malyshev

19 years ago
>> I think, hexdump manipulation functions are very useful string functions. >> I have been using hexdump(), packhex() and smart hex functions, >> written on PHP, and including it in many projects more than 2 years, >> and at last I've implemented it into php core. > > Well, what about PEAR package then?
Yes, sounds like great one for PEAR. Especially that it seems to be debugging function, i.e. not performance-critical, so no problem doing it in pure PHP.
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

Alexander Demin

19 years ago
On 12/26/06, Stanislav Malyshev <stas@zend.com> wrote:
> > >> I think, hexdump manipulation functions are very useful string > functions. > >> I have been using hexdump(), packhex() and smart hex functions, > >> written on PHP, and including it in many projects more than 2 years, > >> and at last I've implemented it into php core. > > > > Well, what about PEAR package then? > > Yes, sounds like great one for PEAR. Especially that it seems to be > debugging function, i.e. not performance-critical, so no problem doing > it in pure PHP. >
Ok, let's do this way. I'll alter the sources into PEAR.
-- Regards, Alexander Demin demin@ots.ru