Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62460 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57596 invoked from network); 24 Aug 2012 21:12:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2012 21:12:06 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:44257] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/36-24287-32EE7305 for ; Fri, 24 Aug 2012 17:12:03 -0400 Received: by pbbrp8 with SMTP id rp8so4124933pbb.29 for ; Fri, 24 Aug 2012 14:12:00 -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=lusJRfL9QKNglM7WKhA6l74dNYvoiHyj0CQWxnkvAms=; b=okP0FVJSYFmQ1eiF+aIBzAVTPe2JObv7W53n7ak/3REQSyLpda8QUksE/H5kEcSN8v V73iQT4kI8Gu8SU+wEoGzczmUZzPaCsF9y9efHHglo4uHzjqNIZxY5GRhOlbCPigB6Xw h2WwwaofFN6j7aO0u11Juy9AsB5Rv5pCT3HnBLf5m4Npa3t2wa36Ed7GsuIFF8chYxTU 3mfuWrcqZEZV7vcJhSDhbLcjomqyoVBAtwhrp1ahbhdj0KWZjaRIjRZWE0HMbcJCy6BI QVk5LTvPDsYabM+vuyfDffnnc1Qav/okZsshAQhK1c3pY5Jxx7iAzfDbij8BtIj98wMu 1fCA== MIME-Version: 1.0 Received: by 10.66.82.3 with SMTP id e3mr13368476pay.56.1345842719915; Fri, 24 Aug 2012 14:11:59 -0700 (PDT) Received: by 10.68.211.37 with HTTP; Fri, 24 Aug 2012 14:11:59 -0700 (PDT) In-Reply-To: <502EBAA4.9090007@gmail.com> References: <502EBAA4.9090007@gmail.com> Date: Fri, 24 Aug 2012 23:11:59 +0200 Message-ID: To: Sebastian Krebs Cc: PHP internals list Content-Type: multipart/alternative; boundary=f46d042de69f3e7f6504c8096d6b Subject: Re: [PHP-DEV] Combined assignment operator for short ternary From: tyra3l@gmail.com (Ferenc Kovacs) --f46d042de69f3e7f6504c8096d6b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Aug 17, 2012 at 11:41 PM, Sebastian Krebs wrot= e: > Hi, > > Don't know, how complicated this is (and also someone (not me) must > implement it, because I can't :X), but to be in sync with the operators t= he > short ternary operator should be usable in conjunction with the assignmen= t > like the other binary operators. Don't know, if anybody understands me :D > So here is an example > > // instead of > $foo =3D $foo ?: 'default'; > // Just > $foo ?:=3D 'default'; > would this trigger a notice if $foo is not defined? if yes, then it would be different from the current behavior of the ternary operator. if no, then I would never use this. I mean if I have to set the variable before the check, then I would put the check into the assignment. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --f46d042de69f3e7f6504c8096d6b--