#21119 [Opn->Csd]: Modified Control Structures

From: Date: Fri, 20 Dec 2002 19:04:36 +0000
Subject: #21119 [Opn->Csd]: Modified Control Structures
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-28120@lists.php.net to get a copy of this message
ID: 21119 Updated by: derick@php.net Reported By: ericf@micgi.com -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: NA PHP Version: 4.2.3 New Comment: if (in_array($x, array ('cats', 'dogs', 'birds))) { should be as useful as introducing a new construct. Derick Previous Comments: ------------------------------------------------------------------------ [2002-12-20 13:01:08] ericf@micgi.com Here's a suggestion that we(local developers in Carbondale,IL) all feel would improve usability of the control structures in PHP. What if in this statement... if (($x == 'cats') && ($x == 'dogs') && ($x == 'birds')) { we instead could say... if ($x IN 'cats','dogs','birds') { This would reduce typing and allow you to compare lists(arrays) in your conditional statements without using array functions. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21119&edit=1

« previous php.bugs (#28120) next »