|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-03-23 08:11 UTC] requinix@php.net
-Status: Open
+Status: Suspended
[2018-03-23 08:11 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
Description: ------------ Currently to compare if a variable have some (?:exact)? value we need to use arrays or enumerate a list of all values + the variable name itself, Ex: $a = true; if ($a === 'a' || $a === 'b' || $a === 'c') # etc... print 'true'; else print 'false'; IMHO will be very very handy if we can evaluate them all in a single expression like this: if ($a === ('a'||'b'||'c') # ... is much cleaner and easier to read and understand the whole sentence Test script: --------------- $a = 'a'; if ($a === ('a'||'b'||'c')) print 'true'; else print 'false'; Expected result: ---------------- true Actual result: -------------- false