Re: Re: What could the intention be of someone using "\0" in comparison be?

Christoph Becker <[email protected]> Tue, 19 Aug 2014 19:06:03 +0200
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
Jacob Kruger wrote:

> Well, if I use var_dump("\0") here on my windows7 64 bit machine, it
> spits out the following:
> string '�' (length=1)

This is the Unicode REPLACEMENT CHARACTER[1].

> And, if I check out the ascii character code of that blank character
> here it returns as 65533

Indeed, that is the REPLACEMENT CHARACTER's code point.

However, the REPLACEMENT CHARACTER is not what is actually stored in the
string denoted by the literal "\0", which is the ASCII character NUL.
You can very this with var_dump(ord("\0\")).

See my reply to Toby (<[email protected]>) for further explanations.

You might it find useful to post general questions regarding PHP to
[email protected] instead of [email protected], as the
latter is rather rarely frequented.

[1] <http://www.fileformat.info/info/unicode/char/0fffd/index.htm>

-- 
Christoph M. Becker

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php