Boolean values: Difference between revisions
Content deleted Content added
added php |
|||
Line 85: | Line 85: | ||
=={{header|Perl}}== |
=={{header|Perl}}== |
||
The values in Perl that are false are: <tt>0</tt> (as a number (including 0.0), or as the string <tt>'0'</tt> |
The values in Perl that are false are: <tt>0</tt> (as a number (including 0.0), or as the string <tt>'0'</tt>, but '''not''' the string <tt>"0.0"</tt>), the empty string <tt>""</tt>, the empty list <tt>()</tt>, and <tt>undef</tt>. |
||
Everything else is true. |
Everything else is true. |
||
Line 91: | Line 91: | ||
Perl has no special "true" or "false" keywords. |
Perl has no special "true" or "false" keywords. |
||
[http://perldoc.perl.org/perlsyn.html#Truth-and-Falsehood] |
[http://perldoc.perl.org/perlsyn.html#Truth-and-Falsehood] |
||
=={{header|PHP}}== |
|||
The values in PHP that are false are: <tt>FALSE</tt>, <tt>NULL</tt>, the number <tt>0</tt> (as an integer <tt>0</tt>, float <tt>0.0</tt>, or string <tt>'0'</tt>, but '''not''' the string <tt>"0.0"</tt>), the empty string <tt>""</tt>, the empty array <tt>array()</tt>, and "SimpleXML objects created from empty tags"(?). |
|||
Everything else is true. The keyword <tt>TRUE</tt> exists. |
|||
[http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting] |
|||
=={{header|Python}}== |
=={{header|Python}}== |