Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113258 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92201 invoked from network); 25 Feb 2021 09:50:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Feb 2021 09:50:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8C95418053D for ; Thu, 25 Feb 2021 01:39:23 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from 2-smtp.kingsquare.nl (2-smtp.kingsquare.nl [77.72.144.59]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 25 Feb 2021 01:39:22 -0800 (PST) X-Gm-Message-State: AOAM532EYZv9Vx6ZKjp+3sHDahVoCz4O3KLqIrcEtOoM24iD8ddMlybS fbZlTN2YCEiGtA2MRhsNLQvDletzF9j9q1J6Ju0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kingsquare.nl; s=kingsquare-a; t=1614245961; bh=qnspk3giQkBGHaSv4jzVwiuwVNeuaD77WxXCtJ4y8TQ=; h=References:In-Reply-To:From:Date:Subject:To:From; b=7mBUZIIHB4/eEu4jg2/o/az7yKmmabtxMoMYtnduKvu9MAKHp1kVILlLKgyzw+qIf 4uYZQ2lyAWHUZI5J3RsYXftcTjcYODRFnQAR4d4PzDD7p093hzjemRcRvk3L+4i3Tw fV7We91TRl1w+8m4iiUWoHHvRLx1F/FERkR67q0U= X-Google-Smtp-Source: ABdhPJw54+yk6u636q1HNSlr8VIPs4SlowzQ744FFiDFPaT56D8Zm8IrgAcTp46UhcfOHXIxJRO/iLEdZlrFE3s6+ZQ= X-Received: by 2002:a5d:4ec6:: with SMTP id s6mr2517963wrv.416.1614245960952; Thu, 25 Feb 2021 01:39:20 -0800 (PST) MIME-Version: 1.0 References: <2664e2ef-b965-407c-90fc-77480846a3ad@www.fastmail.com> <84020328-b623-bca1-0c9c-0f7195e08d23@gmail.com> <8CD7D960-51FA-45FE-B88F-2A18BA768DA4@newclarity.net> In-Reply-To: Date: Thu, 25 Feb 2021 10:39:10 +0100 X-Gmail-Original-Message-ID: Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000152e4505bc25edbe" Subject: Re: [PHP-DEV] Inline conditional that returns null if falsy From: robin@kingsquare.nl ("Kingsquare.nl - Robin Speekenbrink") --000000000000152e4505bc25edbe Content-Type: text/plain; charset="UTF-8" Op do 25 feb. 2021 om 09:55 schreef Rowan Tommins : > On 24/02/2021 04:26, Mike Schinkel wrote: > > Repeating code similar to that from the message sent by David Rodrigues > you can see that eliminating the ": null" is less noisy: > > > >
...
> >
...
> > Also just to have a somewhat apples to apples (working) comparission, it would read something like:
...
...
or one of the other possibilities (print / ">... this atleast is consistent, doesn't provide yet another way of doing the same thing and even allows for easier refactoring (i.e. if the falsy situation has to change from '' to 'offline') to summarize from my 2cent userland developer standpoint: Hope this doesn't make this in... (or is at least strongly discouraged) Thanks, Robin --000000000000152e4505bc25edbe--