I'm drowning in PHP

David Cantrell david at cantrell.org.uk
Tue May 15 13:00:32 BST 2007


On Tue, May 15, 2007 at 12:14:34PM +0100, Andy Armstrong wrote:
> On 15 May 2007, at 11:33, Peter Corlett wrote:
> >Given the quality of typical PHP code, I expect it stores the  
> >length at the
> >end of the string.
> That'd be fun! Scan forward until you get a value that matches how  
> far you've come. The worst of both worlds /and/ subtle bugs when the  
> content of the string happens to look like a plausible length. It's a  
> winner.

Yeah, it's almost as good as using a random character to denote the end
of a string, cos you *never* want to store an ASCII NUL in your strings.
Oh no.

FFS, they could at least have chosen 0xFF which isn't a legal ASCII
character.  And C99 could have added a unicode string to the language
which terminated with 0xFFFE.  Grrr.

-- 
David Cantrell | Godless Liberal Elitist

  For every vengeance, there is an equal and opposite revengeance.
                                            -- Cartoon Law X


More information about the london.pm mailing list