Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107689 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10189 invoked from network); 25 Oct 2019 08:55:58 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 25 Oct 2019 08:55:58 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id E722E2D1FD0 for ; Thu, 24 Oct 2019 23:42:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 24 Oct 2019 23:42:33 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id g7so768646wmk.4 for ; Thu, 24 Oct 2019 23:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=08gOGe+sIxH/F0h0dFApi2LUXC7W/pLz8cZz95zr368=; b=nHMaZ1eHLxGhVsf+XcoaOtLoUEE68Aq+L0uXmV/Q1CNGRbXdo7XJSgyMNHLnPssuIs fUuOaxywYvpmE/swVLghDtLJ+O3z/DPXSeifdmaV9DENFjzFDbvyEEquo9vi94Kne4G/ gYmdzpyGJMtvTDuR6aDz3x58sfkHVHXgO2GrcTmh2rqh137jRIiPXZgAbUZb1UPsIncU RZgouBbytEBZkrchCPE+aNKCUL/TKZNoj2MxdtHEgzjKva23T/XG3RsgXsEVKcs2ASOL w08CPo3rGRIHT8+qPgYtlcpocalY88pk+3VfPdAUaYcDJOQL5s2tKKb6Cf0W27cDwGwX MILQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=08gOGe+sIxH/F0h0dFApi2LUXC7W/pLz8cZz95zr368=; b=lexk7JCqnmo8W+vxTXK7xj8Uvi/wChg21whmF4cm5G34ZaNBZoub/6GIk2JoXEhk9U lSxnfGeFaPVB9OcIOOMfmYR5NIm6dLjOb8S5xMCv3tM7yim8NvRFXULb5FOujhaoOJDh xezUEWN3rfBoAG8t5tiYBN6EtnGrgkxrzQQwNv2w82geLSgWuc4URsD2rwt1kdvdRDcV rHm5eztyXdDt1SkQ9lMe0AFAP59+fM2k4tIXKh8Y3IcmlLMKxIAQFfNR496xoYJap1dZ 8Lp4LLFIicGDdtf7QMGRnDVdx2NGVIqlb241K+sgO/mui+oaPTqtm0E3PeFq2xNkEqoC hvNQ== X-Gm-Message-State: APjAAAXyuOlv4QcaFi5wTLbTzBzJbue+zttSQfQp2EebzCtVNIBlLDwW pFEIPtz4kwzDO45+QtyFCRI= X-Google-Smtp-Source: APXvYqzeC/ufBqZtsIfwA0jsVVHKRT7/NevndNDbUFXQqvOjyXXNMbIKG9UWFajKbthgaBg2afG0iQ== X-Received: by 2002:a7b:cb81:: with SMTP id m1mr1682626wmi.123.1571985752363; Thu, 24 Oct 2019 23:42:32 -0700 (PDT) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id o11sm1084760wmh.28.2019.10.24.23.42.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2019 23:42:31 -0700 (PDT) Message-ID: <3C1F23B1-4B44-432F-A522-E4B9A08608E9@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_C584A26A-77BA-4F80-9661-4D3EC24EBC0F" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Fri, 25 Oct 2019 08:42:30 +0200 In-Reply-To: Cc: Mike Schinkel , PHP internals To: Ken Stanley References: <5db21f54.1c69fb81.eda99.d428SMTPIN_ADDED_MISSING@mx.google.com> <09AB755E-4A05-4D19-8276-BFD658D92EED@newclarity.net> X-Mailer: Apple Mail (2.3445.104.11) X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] anti-coalescing-operator From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_C584A26A-77BA-4F80-9661-4D3EC24EBC0F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 25 oct. 2019 =C3=A0 04:31, Ken Stanley a =C3=A9cri= t : >=20 > If the parameter is null able, I may need to add an if condition to = look up > a sane default value when the parameter comes through as null. It = would be > much more succinct (and less error prone) to be able to say something = like >=20 > /** > * @ParamConverter(name=3D=E2=80=9Capplication=E2=80=9D, ...) > */ > public function myAction(Request $request, Application $application) > { > $user =3D $application->getUser() !?? $this->getUser(); >=20 > // ... do something with user, without worrying about it being null. > } >=20 Did you meant:=20 $user =3D ($application ?? $this)->getUser(); ? =E2=80=94Claude= --Apple-Mail=_C584A26A-77BA-4F80-9661-4D3EC24EBC0F--