spacer spacer spacer

Tips

Use Ternary Operators

The benefit of the ternary operator is debatable (there’s only one, by the way). Here is a line of code from an audit we performed recently: 1 2 3 <?php $host = strlen($host) > 0 ? $host : htmlentities($host); ?> Oops! The author actually means to escape $host if the string length is greater than zero, [...]

Posted in Tips | 6 Comments »

spacer
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.