It basically means that it will work with any bytes string.
If you put control characters, "\n"
, or null character ""chr(0)
"
"
, it will not have any problem replacing.
Example:
$str1 = 'quebra'.chr(0).'de'.chr(0).'linha';
$str2 = str_replace( chr(0), "\n", $str1 );
This works perfectly.
In general PHP functions are, because internally PHP associates the data with a kind of internal "variable" that keeps the size.
In some languages for example, instead of the size being stored, what indicates the end of the string is the null character %code% (which in PHP is returned by %code% ), which would be an example of "no binary safe ".
Note that this is just architectural decisions; it is the task of the programmer to know the language and resolve it as needed. Just if you need a safe string in C, just do as PHP does internally: storing the data size instead of specifying it with a specific character.