Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16569 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5395 invoked by uid 1010); 8 Jun 2005 22:31:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5362 invoked from network); 8 Jun 2005 22:31:09 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 8 Jun 2005 22:31:09 -0000 Received: from ([127.0.0.1:7402]) by pb1.pair.com (ecelerity 1.2 r(5656M)) with ECSTREAM id 3E/AB-52832-CA177A24 for ; Wed, 08 Jun 2005 18:31:08 -0400 X-Host-Fingerprint: 64.202.165.199 smtpout04-04.prod.mesa1.secureserver.net Linux 2.4/2.6 Received: from ([64.202.165.199:47186] helo=smtpout04-04.prod.mesa1.secureserver.net) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 16/6B-52832-24F67A24 for ; Wed, 08 Jun 2005 18:20:50 -0400 Received: (qmail 7594 invoked from network); 8 Jun 2005 22:20:46 -0000 Received: from unknown (66.188.29.245) by smtpout04-04.prod.mesa1.secureserver.net (64.202.165.199) with ESMTP; 08 Jun 2005 22:20:46 -0000 Mime-Version: 1.0 (Apple Message framework v730) Content-Transfer-Encoding: 7bit Message-ID: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: internals@lists.php.net Date: Wed, 8 Jun 2005 18:20:46 -0400 X-Mailer: Apple Mail (2.730) Subject: ifsetor(), goto, 5.x, my two cents From: noah@botimer.net (Noah Botimer) Hello all, Now that my PHP-DEV imap folder has cooled off a bit, I'd like to chime in briefly on ifsetor() and goto. As far as ifsetor() goes, I like the concept. I would, however, suggest a specific behavior and a name change. I do a lot of database code and use things like ISNULL() and COALESCE() to translate NULL values to 0's, placeholder strings, etc. ISNULL() typically provides a check of one value, and acts just as a ternary operation: value = check ? check : alternative; while COALESCE() usually returns the first non-null parameter, or NULL if all are parameters are NULL. Since PHP already supports arbitrary/optional parameters natively, I think a single coalesce() function would be a very reasonable extension that would behave in an understandable and desirable manner (with a name that matches at least some common usage). As for goto, we may be fighting over nothing. There is a lot of abuse that may be done with goto, as has been illustrated but, with a couple of sensible limitations, the horrific problems should be averted. It also seems to me that GOTO is far less often mentioned to beginners as a means of flow control since line-numbered BASIC has faded. People who get into trouble with it will likely have a good reason to be playing with fire. I say: put it in, label it dangerous, and let the developers decide if it's right for them. Thanks, -Noah Botimer