|
Posted by Taras_96 on 01/26/07 13:49
> | To add to the confusion, other websites suggest that 'binary-safe'
> | simply implies that the function can operate on the given data without
> | altering it.
>
> why is that confusing? not only is it correct in this context, but there are
> other meanings of 'binary-safe' in programming.
The manual entry for strcoll states that:
"Note that this comparison is case sensitive, and unlike strcmp() this
function is not binary safe."
I doubt that strcoll alters the data it is given in some way, so I
don't see how it wouldn't be binary safe if you use the definition that
unsafe functions alter data.
Compare this with the functions file(), which is unsafe because it
reads each line into a new elt of the array, effectively destroying the
newline characters, and file_get_contents, which is safe because it
reads the data into the string (it doesn't destroy the data).
It seems here that two different definitions of binary-safe are being
used. Is this an example of the 'other meanings' you mentioned?
Taras
Navigation:
[Reply to this message]
|