Add NULL/FALSE value example to min()

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@332118 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Yasuo Ohgaki 2013-11-15 04:15:36 +00:00
parent 58ccac28c1
commit e3ae54c480

View file

@ -109,6 +109,22 @@ $val = min('string', array(2, 5, 7), 42); // string
</programlisting>
</example>
</para>
<para>
<example>
<title>Example of NULL/FALSE value with <function>min</function></title>
<programlisting role="php">
<![CDATA[
<?php
// PHP compares variable as boolean when one of operand is boolean.
var_dunp(min(-100,-10, NULL, 10, 100); // NULL - (bool)NULL < (bool)-100 is FALSE < TRUE
var_dunp(min(-100,-10, FALSE, 10, 100); // FALSE - (bool)FALSE < (bool)-100 is FALSE < TRUE
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;