PHP coding standards say:
... PHP contains the length property of each line, and should not be evaluated using strlen (). Write your functions in such a way that they can use the length property both for efficiency and for ensuring their binary security ....
How can I access this length property? Or am I misunderstanding?
As Ignacio mentioned in another post :
They talk about the C function, not the PHP function. The function will no longer be considered after the first \ 0, but PHP lines may contain \ 0 in a different place than the end.
, , , PHP-, PHP.
- PHP, PHP.
PHP C, strlen, , C, PHP.
strlen
This is not a โpropertyโ in the sense that it will be in other languages โโ(for example, C #).
You cannot do: myString.Length;
myString.Length;
Instead, you will need: strlen(myString);
strlen(myString);
$string = "foobar"; $l = strlen($foobar); echo $l; //echos 6