On Tue, 1 Nov 2005, Rasmus Lerdorf wrote:

> Derick Rethans wrote:
> > On Tue, 1 Nov 2005, Marco Bambini wrote:
> > 
> > > Thanks a lot Rasmus, I have just (wrongly) assumed that the
> > > convert_to_string
> > > function tries to search for the 0 termination character.
> > 
> > It doesn't - but, PHP strings always require \0 to be the last character so
> > you always need to allocate one more byte and put the \0 in there - even for
> > binary data.
> 
> That's not really a PHP requirement, but more of a good convention to prevent
> something external from falling off the end of a string.  If you are just
> working with it internally you don't need it.

Right, but if you store it as a string in a ZVAL you do, otherwise the 
engine can warn you about it.

Derick

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to