|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-04-04 12:04 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 17:00:01 2025 UTC |
in the case shown below both operators generate different values, once TRUE twice FALSE source code <?php function isValid_and($a) { $valid = true; $b = 1; $valid = $valid and (strlen($a) >= $b); return $valid; } function isValid_and_($a) { $valid = true; $b = 1; $valid = $valid && (strlen($a) >= $b); return $valid; } $a = ""; if (isValid_and($a)) echo "and - true<br/>"; else echo "and - false<br/>"; if (isValid_and_($a)) echo "&& - true<br/>"; else echo "&& - false<br/>"; ?>