Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
DataSecs9378yOh and it's true 😊
Just 0 ist considered false, any others numbers converted to a boolean value are considered true, even negative numbers :D -
SZenC8158y@DataSec Removing the casting would cause the function signature to change, it would then output a number in stead of a boolean. But then again, this code is weird anyway
-
DataSecs9378y@SZenC Oh yea you are right I was thinking of a return type in a function for example, but its necessary in PHP, as you just explained 😊
-
@DataSec Everybody always points out how bad it is and how bad most of the programs written php are.
Related Rants
$a = -1;
if ($a) {
return true;
}
else {
return false;
}
true or false?
undefined
signed
else
if