`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1.
Interestingly, in upstream they started fixing this yesterday, with just this minimal change:
https://secure.phabricator.com/rPf6214f060e780ecf7b565c5a0edbd28d85c03275#C11580NL1139
Premising I don't like that specific patch in upstream, because I don't like counting the length ofcounting the length of a string just to answer the question "is this empty?",
a strbut premising just to answer the question "is this empty?"that adopting stuff like phutil_nonempty_string() could be too risky, but premising that adopting stuff likewe just do
phutil_nonempty_string() could be too riskyan explicit cast to string, we just do an explicit cast to string, to answerto answer the question "Is this string empty?" just like it was done
the question "Is this string empty?" just like it was done under the hood by the strlen() function.
In short, this is probably nice and more readable than upstream (but not a competition).
Closes T15370