Boolean values: Difference between revisions
→{{header|Perl}}: Expanded.
(add JavaScript) |
Underscore (talk | contribs) (→{{header|Perl}}: Expanded.) |
||
Line 183:
=={{header|Perl}}==
The values in Perl that are false are: <tt>0</tt> (as a number (including <tt>0.0</tt>), or as the string <tt>'0'</tt>, but '''not''' the string <tt>
Objects may break these rules at will via [http://perldoc.perl.org/overload.html#*-_Boolean%2c-string-and-numeric-conversion_ overloading].
Perl has no builtin "true" or "false" keywords. However, as a special case, literal <tt>1</tt>s and <tt>0</tt>s will never cause a "Useless use of a constant in void context" warning. Another special case worth pointing out here is that the string <tt>'0 but true'</tt> won't provoke a warning if it's used as a number.
=={{header|PHP}}==
|