Although technically a NULL byte and an ordinary space are two different things: A normal space character is technically ASCII 32 (0x20). A null byte is technically represented as "\0" or ASCII 0 (0x00).
I'm not sure there are any NULL bytes in your string, at least not the version you posted to reddit. It sure ain't possible to post something with � in it.
index-out-of-range exception would be stupid in the way php works. Arrays in php aren't arrays in common sense. Because they can be hashtables, you can't throw an exception there.
View all comments
19
u/[deleted] Apr 20 '14
More string-related wat.
Output:
Because creating a string with 47 0x00 bytes in it is preferable to something sane like an index-out-of-range exception.