This change introduces this very stupid wrapper:
PhabricatorEnv::getEnvConfigString()
This method always returns a string. So, if the value is empty,
the return value is just an empty string. This is useful to simplify
most of our needed checks.
https://we.phorge.it/T15199
So, to verify that a value is not empty, now you can of course:
$value = PhabricatorEnv::getEnvConfigString('foo');
if($value !== '') {
...
}
Or, if you are 100% sure that the value '0' is not useful
at all and can be discarded, you can also love this version
that should be adopted only by true PHP experts and with a
master in type juggling from string to boolean:
$value = PhabricatorEnv::getEnvConfigString('foo');
if($value) {
...
}
In any case - never use a PHP feature unless you know PHP. This
can be not surprising, but it's really something deep and to
keep in mind to avoid over-complications caused by PHP.
In short, with this method is very simple to fix in an elegant and
more efficient way some fixes for PHP 8.2 - as you can see.
Note that it also avoids to use `@strlen()` since it is not efficient,
because it spawns a warning that it's then discarded. Not good for you.
At the moment for example I was able to run some Arcanist commands
without any warning related to strlen(). Wow.
Ref T15190