Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77101 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17706 invoked from network); 8 Sep 2014 08:47:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2014 08:47:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.173 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:39275] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/73-26504-43D6D045 for ; Mon, 08 Sep 2014 04:47:49 -0400 Received: by mail-wi0-f173.google.com with SMTP id cc10so2187687wib.12 for ; Mon, 08 Sep 2014 01:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=g4s+UoH+Rhw59gdPFViuQWe+pMzRUhkz7yVBy/n48MI=; b=DhvlopZUqIsiI6sXoENF9MZlY3Zdlc2HsjJ4BCh84vJ7iiyP7f87NwfZi5g3ADby8R BKU3VYF+9Nfifc+nJhBoruVGKev62Yb38P11W41QNe4RtwqA81nDPtvVdDDb38DyciVM eKw/wb7sAH3pqUqZiDs2FlMEKB/oePboIpwT3ACMk83Xq3IGnvy3CgVdEpdfESnC5CN0 AYtV4DUIe0mzEloGA/QTjq9kdnvmtZaVX2FFpT0AsBY51o75IbgBQcLydQAnGytuu7V5 Rf7lLfOLazc8MtENs5EwWyx1spel9MWjZpjqjxzuScKea5+DYVFCnpeNHdNKzarCs7fO GUNA== MIME-Version: 1.0 X-Received: by 10.194.59.244 with SMTP id c20mr32782775wjr.59.1410166065840; Mon, 08 Sep 2014 01:47:45 -0700 (PDT) Received: by 10.216.35.1 with HTTP; Mon, 8 Sep 2014 01:47:45 -0700 (PDT) In-Reply-To: <540D638B.8010303@php.net> References: <540D638B.8010303@php.net> Date: Mon, 8 Sep 2014 04:47:45 -0400 Message-ID: To: Michael Wallner Cc: Andrea Faulds , Pierre Joye , PHP internals Content-Type: multipart/alternative; boundary=047d7ba977e86dc7e1050289df6c Subject: Re: [PHP-DEV] [RFC] Implicit isset() in Shorthand Ternary Operator From: theanomaly.is@gmail.com (Sherif Ramadan) --047d7ba977e86dc7e1050289df6c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Sep 8, 2014 at 4:06 AM, Michael Wallner wrote: > On 07/09/14 14:25, Andrea Faulds wrote: > > > > > There=E2=80=99s actually a quite serious issue just now, which is that = it > > evaluates the first operand twice if it=E2=80=99s not empty. This is be= cause > > $a ?: $b is expanded to empty($a) ? $b : $a, such that if you did > > something which mutates state in there, it=E2=80=99d happen twice. This= is > > obviously not good, and I=E2=80=99m going to figure out how to fix this= . > > > > This could very well be the reason why it is like it is today. > > I agree. The more I think about, the more this seems weird. What if I explicitly want to use ternary to check isset() and not empty? --047d7ba977e86dc7e1050289df6c--