Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77311 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86568 invoked from network); 18 Sep 2014 16:08:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2014 16:08:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.179 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.216.179 mail-qc0-f179.google.com Received: from [209.85.216.179] ([209.85.216.179:48504] helo=mail-qc0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/50-18130-B630B145 for ; Thu, 18 Sep 2014 12:08:12 -0400 Received: by mail-qc0-f179.google.com with SMTP id x13so1608977qcv.24 for ; Thu, 18 Sep 2014 09:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=MOIPk3srErvrlR4x3p9bzKoJ4SJ7d/nCPU4UkdF2Pow=; b=yWNm5xzBz0XQbayw3IcujVfjaCVSdXpb7Bi6AiwCAlBErfwfT/v9/rPros2Bx7dW0Q GwwbTuwewEZsSIduSex/W+5HbP5O/VC9XcIlsnTDXDnReghUxfhTUZUk9XPl57QbVDrs UHExwVzI6Jtj87+A14+cnaV/JftNun7ByBRGvBCyBkKAW4rwjEB0bCEJ2whWlPdbv0a/ Z6RA4S8UDiV3kzICjDXIczeilRw7FFFgILdYK1Q/oV20sjNoJzmx3cLnIJmexpHYZWg3 Pm05kFSlWnBnJkupbTGq8qzJouDDL4/SYoMZL8uM1lMY0HpskWBPOCPrT2Tk/00EnwZH Gpyw== MIME-Version: 1.0 X-Received: by 10.224.28.133 with SMTP id m5mr10317330qac.16.1411056489151; Thu, 18 Sep 2014 09:08:09 -0700 (PDT) Sender: are.you.winning@gmail.com Received: by 10.141.28.193 with HTTP; Thu, 18 Sep 2014 09:08:09 -0700 (PDT) In-Reply-To: <1411047248.3023.78.camel@guybrush> References: <54E82419-931D-4F9E-8115-175EA1BDC970@darkrainfall.org> <1411047248.3023.78.camel@guybrush> Date: Thu, 18 Sep 2014 17:08:09 +0100 X-Google-Sender-Auth: PlRNWObjIoPB7QQtuEGj-Rk6o5A Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: Andrea Faulds , Pete Boere , Gwynne Raskind , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Implicit isset() in Shorthand Ternary Operator From: cw@daverandom.com (Chris Wright) On 18 September 2014 14:34, Johannes Schl=C3=BCter = wrote: > On Thu, 2014-09-18 at 12:41 +0100, Andrea Faulds wrote: >> We could use a function *syntax*, though, but I don=E2=80=99t like this = idea. >> coalesce() and ifsetor() are both ugly to me, and it=E2=80=99s not super >> obvious what they do: >> >> var_dump(coalesce($_GET[=E2=80=98foobar=E2=80=99], 3)); >> >> vs. >> >> var_dump($_GET[=E2=80=98foobar=E2=80=99] ?? 3); >> >> ?? also has the advantage of being shorter. >> > If you don't now what ?? does it's far from obvious. coalesce is a term > that can be put into google and will deliver results. On the flip side, coalesce() etc would introduce another keyword, which would be a BC break, unless we also manage to get keywords-as-identifiers working and accepted for the same release. I wouldn't mind betting there are quite a few applications out there with a function/method called coalesce() defined... I know there's at least one, because I work on it regularly, and github has over 100,000 hits for it (the vast majority of these are in SQL strings but I still found 4 PHP functions/methods on the first 3 pages): https://github.com/search?q=3Dcoalesce+language%3Aphp&type=3DCode