Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46143 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57193 invoked from network); 21 Nov 2009 08:48:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Nov 2009 08:48:17 -0000 Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:39922] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/12-40936-F49A70B4 for ; Sat, 21 Nov 2009 03:48:16 -0500 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id 36B114144059; Sat, 21 Nov 2009 08:49:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LzcJJtaVbXAz; Sat, 21 Nov 2009 09:49:16 +0100 (CET) Received: from [192.168.0.151] (217-162-131-234.dclient.hispeed.ch [217.162.131.234]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 338444144009; Sat, 21 Nov 2009 09:49:16 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii In-Reply-To: <17.CC.25743.CB6770B4@pb1.pair.com> Date: Sat, 21 Nov 2009 09:48:10 +0100 Cc: internals@lists.php.net Content-Transfer-Encoding: 7bit Message-ID: <84B23126-8011-48DA-B65A-750AA9C5B57E@pooteeweet.org> References: <17.CC.25743.CB6770B4@pb1.pair.com> To: Alban X-Mailer: Apple Mail (2.1077) Subject: Re: [PHP-DEV] suggestion about ternary operator From: mls@pooteeweet.org (Lukas Kahwe Smith) On 21.11.2009, at 06:12, Alban wrote: > This is not a big problem but if a solution exists, this would be so > cool ! Especialy when we have to check existance of twenty or more key in > array. Code would be be lighter and clear. > Since i use PHP, I always have in my 'common function file' a function > like that : > > function getIssetVar($var, $default) { return ((isset($var)) ? $var : > $default); } > > So is it possible to make a little improvement on this operator or > introduce a new operator or a core function which do that ? What's your > feeling about it ? this feature request has already been discussed and declined: http://wiki.php.net/rfc/ifsetor please review this rfc before continuing this thread. regards, Lukas Kahwe Smith mls@pooteeweet.org