|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-04-27 15:05 UTC] jimw@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 04:00:02 2025 UTC |
such a syntax would be nice: if (getColor() == ['green'|'blue']) { if (someFunction() != [true&null]) { if (xy() >= [$x&$y]) { which means if ((getColor() == 'green') || (getColor() == 'blue')) { but saves one call to the function or $myCol = getColor(); if (($myCol == 'green') || ($myCol == 'blue')) { but looks better and saves a temp var. $tmp = functionThatReturnsBool(); if ($tmp == true OR $tmp == null) { sometimes it could be done with if (in_array(getColor(), array('green', 'blue'))) { but not always. fab