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

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -