Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62249 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24159 invoked from network); 18 Aug 2012 22:20:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Aug 2012 22:20:35 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 64.22.89.134 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 64.22.89.134 oxmail.registrar-servers.com Received: from [64.22.89.134] ([64.22.89.134:52558] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/93-00850-33510305 for ; Sat, 18 Aug 2012 18:20:35 -0400 Received: from [192.168.0.200] (5ad4bfa0.bb.sky.com [90.212.191.160]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id B4279F002C; Sat, 18 Aug 2012 18:20:32 -0400 (EDT) Message-ID: <50301516.7050906@ajf.me> Date: Sat, 18 Aug 2012 23:20:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Tjerk Meesters CC: Sebastian Krebs , PHP internals list References: <502EBAA4.9090007@gmail.com> <02282E6D-EFB4-44F0-BFA0-60D3E9F9D5B6@gmail.com> In-Reply-To: <02282E6D-EFB4-44F0-BFA0-60D3E9F9D5B6@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Combined assignment operator for short ternary From: ajf@ajf.me (Andrew Faulds) On 18/08/12 03:36, Tjerk Meesters wrote: > > Sent from my iPhone > > On 18 Aug, 2012, at 5:41 AM, Sebastian Krebs wrote: > >> 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 the short ternary operator should be usable in conjunction with the assignment like the other binary operators. Don't know, if anybody understands me :D So here is an example >> >> // instead of >> $foo = $foo ?: 'default'; >> // Just >> $foo ?:= 'default'; > Why not just: $foo ?= 'default'; Just noting, I made a ML email earlier about this, except it would be shorthand for isset($lval) ? $lval : $default. And this has been brought up before several times. >> I have many of this "default assigments" and yes: This is just syntactic sugar. >> >> Regards, >> Sebastian >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> -- Andrew Faulds http://ajf.me/