Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51907 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66689 invoked from network); 14 Apr 2011 16:21:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2011 16:21:01 -0000 Authentication-Results: pb1.pair.com header.from=landeholm@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=landeholm@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: landeholm@gmail.com X-Host-Fingerprint: 209.85.218.42 mail-yi0-f42.google.com Received: from [209.85.218.42] ([209.85.218.42:53030] helo=mail-yi0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/C0-59898-BEE17AD4 for ; Thu, 14 Apr 2011 12:20:59 -0400 Received: by yib12 with SMTP id 12so973425yib.29 for ; Thu, 14 Apr 2011 09:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=2RAfdYYtn9PCx+wwmOsvbzL5nIf8Vd8KiEEsY4meYH4=; b=nciCijpOKEve3UHsUrxuhFWXwrhyuV7Z5lCzmDtTMV3GSHRqElM3pt2ZE1ufThIj2j 9johOKxxb+WJ54LYPT1YECT7Wks5r57krFfCR15tXV879CbMB0oaa5JgcoekzEtCT0Tb 5KGEerWPUdJPkliGG1cOCTwW7MECBZ7I6wZYo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=LOA3o8O4baW6a6gp4TqG1E/AB4y8+w1QzNIe8VyprFCY9rkSbB3CXk8mHs4lw3EQvM Pz/u/nglITefYJB2s7IHjk7zjEvfcMNaG6WN+zV0C/epG8gS62QN9lgF/ml8CjovFe2H RmXTLmUHixVCzCKf/aK7O3za6WMg6wN9wC1EE= MIME-Version: 1.0 Received: by 10.42.72.131 with SMTP id o3mr1286982icj.234.1302798056076; Thu, 14 Apr 2011 09:20:56 -0700 (PDT) Received: by 10.231.33.139 with HTTP; Thu, 14 Apr 2011 09:20:55 -0700 (PDT) In-Reply-To: References: <4D9E96B6.6060401@lerdorf.com> <718216446.20110408143441@cypressintegrated.com> <4DA0E71C.9030008@gmail.com> <4DA63ED8.4080402@yahoo.com.au> <4DA6F2BC.10706@yahoo.com.au> <4DA6FB03.9040404@yahoo.com.au> Date: Thu, 14 Apr 2011 18:20:55 +0200 Message-ID: To: Ole Markus With , internals@lists.php.net Content-Type: multipart/alternative; boundary=90e6ba6e84e858b71d04a0e34fd3 Subject: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: landeholm@gmail.com (Hannes Landeholm) --90e6ba6e84e858b71d04a0e34fd3 Content-Type: text/plain; charset=ISO-8859-1 Nope. I prefer to treat "invalid" or "non existing" basic types as them being set to a default value. This makes the input handler very robust and I don't have to waste time by writing code that handles failed validation. For example if I read an integer from $_POST I'd simply write: $value = \intval(@$_POST["field"]); (or a boolean:) $value = (@$_POST["field"] == "set"); I'd prefer this syntax though: $value = \intval($_POST["field"]??); ..simply because it's a more precise expression and no notice is generated and have to be ignored when running the custom error handler - so it should be faster too. ~Hannes On 14 April 2011 18:08, Ole Markus With wrote: > On Thu, 14 Apr 2011 16:05:45 +0200, Hannes Landeholm > wrote: > > So basically the discussion now is what exact characters that should be >> used >> to represent this operator? I really hope we can get this implemented >> quickly... I worked with $_POST yesterday and I could really use that ?? >> operator. >> >> > When it comes to $_POST you probably want to use filter_input instead. > > Cheers, > Ole Markus With > --90e6ba6e84e858b71d04a0e34fd3--