Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91552 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78296 invoked from network); 8 Mar 2016 20:18:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2016 20:18:24 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 212.232.28.124 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.28.124 mx203.easyname.com Received: from [212.232.28.124] ([212.232.28.124:33651] helo=mx203.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/2C-03587-B833FD65 for ; Tue, 08 Mar 2016 15:18:22 -0500 Received: from cable-81-173-133-29.netcologne.de ([81.173.133.29] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1adO58-0006bJ-KZ for internals@lists.php.net; Tue, 08 Mar 2016 20:18:14 +0000 Reply-To: internals@lists.php.net References: <4DF77339-7112-4F26-A98D-82E6492880C2@gmail.com> To: internals@lists.php.net Message-ID: <56DF3373.1020909@fleshgrinder.com> Date: Tue, 8 Mar 2016 21:17:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <4DF77339-7112-4F26-A98D-82E6492880C2@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qjxattCt4im1AhkUDq8pQnKB9hohgEk6s" Subject: Re: [PHP-DEV] Equal Null coalescing operator ??= https://github.com/php/php-src/pull/1795 From: php@fleshgrinder.com (Fleshgrinder) --qjxattCt4im1AhkUDq8pQnKB9hohgEk6s Content-Type: multipart/mixed; boundary="i4slRGFgOKHUUDOhQWwdUC6CofL1E12e0" From: Fleshgrinder Reply-To: internals@lists.php.net To: internals@lists.php.net Message-ID: <56DF3373.1020909@fleshgrinder.com> Subject: Re: [PHP-DEV] Equal Null coalescing operator ??= https://github.com/php/php-src/pull/1795 References: <4DF77339-7112-4F26-A98D-82E6492880C2@gmail.com> In-Reply-To: <4DF77339-7112-4F26-A98D-82E6492880C2@gmail.com> --i4slRGFgOKHUUDOhQWwdUC6CofL1E12e0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/8/2016 6:59 PM, Midori Kocak wrote: > Remember my question?=20 >=20 > $this->request->data['comments']['user_id'] =3D $this->request->data['c= omments']['user_id'] ?? =E2=80=98value=E2=80=99; >=20 > I want to check if some var is null and if the same var is null set the= same var to =E2=80=98value=E2=80=99. >=20 > Hence I am repeating the same variable after the equal operator, this d= oes not feels right. >=20 > So I feel that we need another operator like =E2=80=9C??=3D=E2=80=9C si= milar to +=3D; >=20 > $this->request->data['comments']['user_id=E2=80=99] ??=3D =E2=80=98val= ue=E2=80=99. So if the var is null it=E2=80=99s set to =E2=80=98value=E2=80= =99 and else stays the same. >=20 > I implemented it. Please check this here: https://github.com/php/php-sr= c/pull/1795 >=20 > Midori >=20 +1 Very handy addition! --=20 Richard "Fleshgrinder" Fussenegger --i4slRGFgOKHUUDOhQWwdUC6CofL1E12e0-- --qjxattCt4im1AhkUDq8pQnKB9hohgEk6s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW3zN+AAoJEOKkKcqFPVVrAMwQALL4qhbgIYhzB51ebnv/81KD bdMWsAgUhjVBx20skIvD+zlNb4ix3DAh525AVpcK1MuW4o5x6SVSzTThrn9uVhT9 EutWyqPng21pIt+CUqJ/WbA0jMeDVu2mTBp88eLWCt8CsyXMD90hpjxBZshKgWHC +wf7DeXh5loOae3Nql4mdVFSgyQEtdwhCMUdrszmqIYrc+yux+merFhHEVtCgBSW r7VyQbdfYwSb8690CVgMX98lI/cU0evlOB6CK5C9h4GaeUwmysZ3b8yxyS9r5D0R rzVmYN+G1OxvPCY9iIkbCn639/Wj9AgTLY2fjqlnSzGyES4J771Sh/N/j+8SLc0v I7wAwchMMSOQgPJ7lK0Ke9UN1hleFyU1GU14+0td85MJCcm7FJ925bE2lACaQMVO tt10bu/4F5j63ll4CoVxd8TvCAgMcMSYo+pqOikwvEXf66pxl1NOUm1G993LgWFj stuvFN/wBIoldLy67R/mZmmkW9E5IgOVT/IywWzFGCfcIBfZV7snI1ZMpbvPO7Gd cSJDX4kLslMfx9G9i+3rv/1vdX5QfDFLH33MhpwHDAg4MXU9/BAvwxsMDOG0ldtX 1+FFCerlsc1bMP8ElxDcbQ5oI+igU2XZRLV66J3haji7n2JBd3INu2Ypyy7zuCAx OXyS1s5NtHAUSjTqd23g =alp3 -----END PGP SIGNATURE----- --qjxattCt4im1AhkUDq8pQnKB9hohgEk6s--