|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-19 22:36 UTC] jed at jed dot bz
[2004-11-20 01:55 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 08:00:01 2025 UTC |
Description: ------------ Some languages such as SQL or (cough)Visual Basic(cough) include an "in" operator to test for inclusion in a given range of values. SQL uses an explicit list of values like so: SELECT s1 FROM t1 WHERE s1 IN (SELECT s1 FROM t2); Or an even simpler example: SELECT 'foo' IN ('foo','bar','foobar'); Visual Basic makes it even better by adding the ellipsis operator: if iBar in (25..40) then This would be a great addition to PHP, with or without the ellipsis operator. It would be especially useful for switch statements. And if you could pass it an array, I'd be in heaven!