I'm using Windows 10 Home Single Language Edition which is a 64-bit Operating System on my machine.
I've installed the most latest version of XAMPP which has installed PHP 7.2.7 on my machine.
I'm asking this question based on the excerpt taken from the PHP Manual :
The string in PHP is implemented as an array of bytes and an integer indicating the length of the buffer. It has no information about how those bytes translate to characters, leaving that task to the programmer. There are no limitations on the values the string can be composed of; in particular, bytes with value 0 (“NUL bytes”) are allowed anywhere in the string (however, a few functions, said in this manual not to be “binary safe”, may hand off the strings to libraries that ignore data after a NUL byte.)
I understand very well the difference between binary-safe and non-binary safe functions in PHP. I've following doubts in my mind. Please answer them in one-by-one fashion with appropriate explanation accompanied with suitable examples.
- Is the phenomenon of "non-binary safe" and "binary-safe" functions present in PHP only because the entire PHP parser has been written in C language?
- What are the differences between C and PHP in case of handling strings containing any value(including NUL byte)?
- I want the complete lists of functions in PHP which are "non-binary safe" and which are "binary-safe".
- Is the characteristic of "non-binary safe" and "binary-safe" applicable only to functions that manipulate over strings and not applicable to PHP functions that deal with other types in PHP?
- Why do the non-binary safe functions hand off the strings to libraries?
- Do the non-binary safe functions hand off the strings to libraries only when the string they are handling contains NUL byte?
- What are those libraries to which these "non-binary safe" functions hand off the strings?
- How these libraries handle the strings received from "non-binary safe" functions?
- Do the "non-binary safe" functions work like "binary safe" functions after handing off the strings that contain NUL byte to some library?