|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-09-13 17:57 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 04:00:01 2025 UTC |
<? function f($p = "all") { if ($p == "all") { print "if condition true, p = $p"; } else { print "if condition false, p = $p"; } print "<br>"; } f(); f(0); f(1); ?> The output of this script is: if condition true, p = all if condition true, p = 0 if condition false, p = 1 and the problem is actually in second row generated by function call f(0). In this case $p is 0 but the condition $p == "all" is true!