Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84686 invoked from network); 22 Nov 2009 04:23:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Nov 2009 04:23:52 -0000 X-Host-Fingerprint: 86.210.33.42 ANantes-552-1-34-42.w86-210.abo.wanadoo.fr Date: Sat, 21 Nov 2009 23:23:51 -0500 Received: from [86.210.33.42] ([86.210.33.42:14202] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/01-11660-6DCB80B4 for ; Sat, 21 Nov 2009 23:23:51 -0500 Message-ID: <7C.01.11660.6DCB80B4@pb1.pair.com> To: internals@lists.php.net References: <17.CC.25743.CB6770B4@pb1.pair.com> <84B23126-8011-48DA-B65A-750AA9C5B57E@pooteeweet.org> <4B082F9E.6080703@lerdorf.com> <83.40.11660.FE2B80B4@pb1.pair.com> <4B08B57E.9090409@lerdorf.com> User-Agent: Pan/0.133 (House of Butterflies) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Posted-By: 86.210.33.42 Subject: Re: [PHP-DEV] suggestion about ternary operator From: seza@paradoxal.org (Alban) Le Sat, 21 Nov 2009 19:52:30 -0800, Rasmus Lerdorf a écrit : > > Or better yet, have your filter function return false if the variable > doesn't exist and use the ternary to set the default. You can do it all > in a single step then. > > $var = filter_func($_GET,'foo')?:42; > > Simple and clean. > > -Rasmus Yes, as you say, simple and clean ! Have I miss something like that in php ? -- Alban Leroux