Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110969 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24106 invoked from network); 13 Jul 2020 00:55:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2020 00:55:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 85ABF1804A7 for ; Sun, 12 Jul 2020 16:47:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 12 Jul 2020 16:47:16 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 83C945C0065 for ; Sun, 12 Jul 2020 19:47:15 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Sun, 12 Jul 2020 19:47:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=tHufC0 ldzBnjxwvEAG2KCB6Y236cqYxDMdWurCG07M0=; b=lBEmgS7jp7/fc9ipLhOWRK FT/C88eXdcp/FIvLoxns0zrxwxIqb4RSQKTA7Eu+SIbjAVAMBXIwaPmycb2O60w8 ZROszde3Geox6gsxT9Ib0HTnk4BskVudPxy3Jj2vAc5QeDKagzz/rfMmXa5gkxXi RvO7eqLL/3ja3MeIfEirjGvegWe0Jfs3gTg5mWPZZp3uVyAPywbi9LobzeCANvlJ PSG1vuB4tO3E62F0BiNg/LT0laDj63SPtc3R4GRY9FB4yfYZwbOCYySg2wYT+PIQ NFYtOjNqHEMbomANTBUbQ8a5Fl2X8Gz9ZrB6+z6nfFQsNv7Ewd2k2lwkVBn+PzLA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrvdejgddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefofgggkfgjfhffhffvufgt sehttdertderreejnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrg hrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhepvedt feevfeejheejkedtffduffetfedtveevffeitdejkeffhefhveelgfehhedtnecuffhomh grihhnpegsihhtrdhlhidpvgigthgvrhhnrghlshdrihhonecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguth gvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 536F414200A2; Sun, 12 Jul 2020 19:47:15 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-613-g8a73ad6-fm-20200709.001-g8a73ad6e Mime-Version: 1.0 Message-ID: In-Reply-To: <7238EFA9-8BE4-48E2-B6C6-6C3E14CFA208@joshbruce.dev> References: <7238EFA9-8BE4-48E2-B6C6-6C3E14CFA208@joshbruce.dev> Date: Sun, 12 Jul 2020 18:46:54 -0500 To: "php internals" Content-Type: text/plain Subject: =?UTF-8?Q?Re:_[PHP-DEV]_[CONCEPT][DISCUSSION]_Allow_objects_to_declare_e?= =?UTF-8?Q?mptiness_and_by_extension_truthiness?= From: larry@garfieldtech.com ("Larry Garfield") On Sun, Jul 12, 2020, at 12:48 PM, Josh Bruce wrote: > Latest version as we zero in on what this is really about: > https://bit.ly/php-0002 > > Other threads: > > 1. https://externals.io/message/110879 > 2. https://externals.io/message/110881 > > Thanks for all the feedback so far! Definitely feels like progress. > > Cheers, > Josh Hi Josh. This is a big improvement, and I think focuses on the useful value-add a lot better. Basing it off of Countable rather than Stringable is, I think, a safer overall approach, especially as it then gets us toBool as effectively a side-effect. There's 2 additional improvements I'd suggest: 1) The 2 places that you have lists of "this thing produces true/false" could likely stand to be turned into tables to make it clearer, especially when demonstrating that isEmpty() and __toBool() are effectively opposites of each other so we get a 2-for-1 deal. 2) Include some less-random examples of real "empty" objects. Also, please be warned that the PHP wiki doesn't use Markdown. It uses some wonky proprietary ancient mess instead. Now that you have Wiki access you should probably start using the PHP Wiki instead of Github so that you don't have to convert a mess of nice formatting from Markdown to PHPWiki-down. I like this idea and wish I had the skillz to help implement it. :-) --Larry Garfield