Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16582 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4095 invoked by uid 1010); 9 Jun 2005 18:04:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 4069 invoked from network); 9 Jun 2005 18:04:35 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 9 Jun 2005 18:04:35 -0000 X-Host-Fingerprint: 169.229.139.92 dhcp-139-92.OHR.Berkeley.EDU Received: from ([169.229.139.92:8588] helo=localhost.localdomain) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 38/CE-21296-BFD78A24 for ; Thu, 09 Jun 2005 13:35:55 -0400 Message-ID: <38.CE.21296.BFD78A24@pb1.pair.com> To: internals@lists.php.net References: <5.1.0.14.2.20050603203711.028e9140@localhost> <200506051859.53976.magnus@php.net> <6E.27.21296.C90E7A24@pb1.pair.com> Date: Thu, 9 Jun 2005 10:35:52 -0700 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 X-Posted-By: 169.229.139.92 Subject: Re: [PHP-DEV] PHP 5.1 From: pollita@php.net ("Sara Golemon") > > What about ifsetor for 5.1 ? > > Would anybody be interested in a parameter for ifsetor() that would treat > isset() as !empty() or an alternative function that achieves this? I know > I'd love to see that. I use empty() a lot more than isset(). > In the interrest of KISS, I'd leave the emptiness concept out of the picture. Unlike isset-ness, an emptiness coalesce *can* be done in userspace: function firstNotEmpty() { $vars = func_get_args(); foreach($vars as $var) if (!empty($var)) return $var; return NULL; } There's enough....contention over the undeniably useful and not-implementable-in-userspace parts of this thread that it's not worth muddling it up with things that are a simple matter to do in userspace. It doesn't matter that notempty() and ifsetor() could easily be implemented by the same opcode (just like isset/empty are). -Sara