mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
58ccac28c1
commit
e3ae54c480
1 changed files with 16 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue