php shorthand return statement -


so looking examples of validating unix timestamp. 1 code chunk kept reappearing this:

function isvalidtimestamp($strtimestamp) {     return ((string) (int) $strtimestamp === $strtimestamp)          && ($strtimestamp <= php_int_max)         && ($strtimestamp >= ~php_int_max); } 

now have looked shorthand return if statements think might not having luck. can explain me how function deciding return , how. thanks

the result of boolean operations (like &&, || or ==) boolean, result of numeric operations (like + , *) number. return 2 + 3 yield 5, return true && false return false. now, operations can, of course, nested. example, return (2 + 3) * (3 + 3) still valid expression , yields 30. in same manner, return ($a === $b) && ($a => $c) yield boolean value.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -