Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89348 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14312 invoked from network); 23 Nov 2015 20:12:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2015 20:12:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=shadda@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=shadda@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.48 as permitted sender) X-PHP-List-Original-Sender: shadda@gmail.com X-Host-Fingerprint: 209.85.220.48 mail-pa0-f48.google.com Received: from [209.85.220.48] ([209.85.220.48:34436] helo=mail-pa0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/9A-47837-B2373565 for ; Mon, 23 Nov 2015 15:12:27 -0500 Received: by padhx2 with SMTP id hx2so201265202pad.1 for ; Mon, 23 Nov 2015 12:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WvvtOpT2DPPAL7RdLdW9/EPKFsNm5OYqvKnmksmRKho=; b=WThDlzjsKpgcV+lwGzpBpa5QZZf8j8uq1pnX9tZ3cUpy8+dxabFUXh+cGwVxeLV9sP 5OsDicmsZtpBnGF9iTKhaJzDeAcC2l2JfdCrsfwHJjNBr3eo4CDTmit2JdNuKTNBPGXc GCnqwhEDKpOLocuHcsMySVmemqKroWiEjY3xXGb+u3AeZ7z/aaKsc4Pd1hMhwFxgPWl7 CvrSHW/8qIkKCUC8ymfGvQOvspjG/YyZlS2t5pLazVJs1yojhUVHPlC8LoOv2j5eRldW MihuOmteeZ4pfiUBKsVEFKJqZfhQ4vEjcFpwO38LbsJ9ueEHPu5M9rk6E/Iysm5VMMjX SUOw== X-Received: by 10.68.244.35 with SMTP id xd3mr37958562pbc.1.1448309544312; Mon, 23 Nov 2015 12:12:24 -0800 (PST) Received: from [192.168.0.18] (70-36-238-3.dsl.static.fusionbroadband.com. [70.36.238.3]) by smtp.gmail.com with ESMTPSA id rx10sm11496382pab.21.2015.11.23.12.12.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 12:12:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) In-Reply-To: Date: Mon, 23 Nov 2015 12:12:22 -0800 Cc: Andrea Faulds , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <4D5D4A6D-1E94-4893-B1DF-7A8C616C871A@gmail.com> <20.F5.23339.A9822565@pb1.pair.com> To: Levi Morrison X-Mailer: Apple Mail (2.3094) Subject: Re: [PHP-DEV] PHP7 Coalesce operator From: shadda@gmail.com (shadda) Oh, please, by no means take that as an endorsement for dropping error = reporting levels. It was just an observation of how PHP actually derives = a conditional in those situations. It=E2=80=99s not as if there=E2=80=99s = a fatality in script execution when you make that kind of comparison, = it=E2=80=99s just a really shitty way to code. In fact, it=E2=80=99s = also why i typically avoid empty(). Nevertheless, PHP lacks a concise = solution for dealing with multiple possibly-false-evaluating values.=20 Hacks like my coalesce() function that rely on the side effect of = reference-passing can only go so far, as there=E2=80=99s also no way to = pass &N references (at least that I=E2=80=99m aware of, correct me if = I=E2=80=99m wrong) I mean really I just want to be able to easily and lazily handle = situations where I=E2=80=99ve got several vars as possible values in an = assignment or expression, without chaining lots of function calls. = Perhaps if empty() took N params like isset() does, but that=E2=80=99s = only a nudge in the, er, =E2=80=9Cright=E2=80=9D direction. =20 > On Nov 23, 2015, at 12:03 PM, Levi Morrison wrote: >=20 >> In practice, you can ignore E_NOTICE and php will happily treat null = and !isset() as the same thing in *most* cases, so that=E2=80=99s not a = good indicator of truthiness. >=20 >=20 > If you really believe that then this is all you need already: >=20 > $database =3D $config['database'] ?: 'db'; >=20 > Correct?