2 ms·
> $x = @$f["x"] is right place to use it. No, it's not. There's built-in methods for that: isset() and empty().
by jtreminio 14y ago
> $x = @$f["x"] is right place to use it.
No, it's not. There's built-in methods for that: isset() and empty().
- narcissus 14y agoOr array_key_exists(), depending on exactly what you're hoping for :(
- pavel_lishin 14y agoempty() is not a good idea. What if $f["x"] is an empty string ""? Or 0, or 0.0, or "0", or any of the other values for which it returns true?
- jtreminio 14y agoIt completely depends on the use case. My point was, don't use @