Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110974 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59384 invoked from network); 13 Jul 2020 16:26:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2020 16:26:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 857FA1804DB for ; Mon, 13 Jul 2020 08:18:14 -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_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from beige.elm.relay.mailchannels.net (beige.elm.relay.mailchannels.net [23.83.212.16]) (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 ; Mon, 13 Jul 2020 08:18:10 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|josh@joshbruce.dev Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 961C5121ABD; Mon, 13 Jul 2020 15:18:08 +0000 (UTC) Received: from pdx1-sub0-mail-a1.g.dreamhost.com (100-96-8-53.trex.outbound.svc.cluster.local [100.96.8.53]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E49EF120F06; Mon, 13 Jul 2020 15:18:03 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|josh@joshbruce.dev Received: from pdx1-sub0-mail-a1.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.8); Mon, 13 Jul 2020 15:18:08 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|josh@joshbruce.dev X-MailChannels-Auth-Id: dreamhost X-Irritate-Occur: 3d6896cb78bea9bd_1594653488385_3723857118 X-MC-Loop-Signature: 1594653488385:1300240671 X-MC-Ingress-Time: 1594653488385 Received: from pdx1-sub0-mail-a1.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTP id 91D42B3403; Mon, 13 Jul 2020 08:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=joshbruce.dev; h=from :message-id:content-type:mime-version:subject:date:in-reply-to :cc:to:references; s=joshbruce.dev; bh=6Jg9QfmvgwrgEU+yxryS6re37 88=; b=AbU1Vr6/cPLViNuKAbpC4fdBjMuLGmcAfYFBs9RuHunJMlZMPqR65xjT4 gFxOyb4zyFBnnVK0UJ4/Q7CKtAU7CPYQ3ZgeIX93RFXhcVOoV3SBom7q4wB2uz74 q92g6aFI+/PrJxDjshX6/AX3qJh01nbH7/9M/t2BabJcFnkrqo= Received: from joshs-mbp.lan (21.140.29.136.in-addr.arpa [136.29.140.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: josh@joshbruce.dev) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTPSA id 81375B3418; Mon, 13 Jul 2020 08:18:02 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a1 Message-ID: <650DF548-4D3C-4AE6-8A15-82BAF2106B77@joshbruce.dev> Content-Type: multipart/alternative; boundary="Apple-Mail=_06D56177-374B-4F76-8D59-85DEADE7ACCC" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Date: Mon, 13 Jul 2020 10:18:00 -0500 In-Reply-To: Cc: php internals To: Larry Garfield References: <7238EFA9-8BE4-48E2-B6C6-6C3E14CFA208@joshbruce.dev> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -51 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedrvdekgdekkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefhkfgtggfuffgjvfhfofesrgdtmherhhdtjeenucfhrhhomheplfhoshhhuceurhhutggvuceojhhoshhhsehjohhshhgsrhhutggvrdguvghvqeenucggtffrrghtthgvrhhnpeeigeefveeiudevkeelffevvdduudevtdekvdejtdegtddugfejvdeukeevvedvgeenucffohhmrghinhepsghithdrlhihnecukfhppedufeeirddvledrudegtddrvddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepjhhoshhhshdqmhgsphdrlhgrnhdpihhnvghtpedufeeirddvledrudegtddrvddupdhrvghtuhhrnhdqphgrthhhpeflohhshhcuuehruhgtvgcuoehjohhshhesjhhoshhhsghruhgtvgdruggvvheqpdhmrghilhhfrhhomhepjhhoshhhsehjohhshhgsrhhutggvrdguvghvpdhnrhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght Subject: Re: [PHP-DEV] [CONCEPT][DISCUSSION] Allow objects to declare emptiness and by extension truthiness From: josh@joshbruce.dev (Josh Bruce) --Apple-Mail=_06D56177-374B-4F76-8D59-85DEADE7ACCC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 >> Latest version as we zero in on what this is really about:=20 >> https://bit.ly/php-0002 >>=20 > 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. I appreciate this idea - done. >=20 > 2) Include some less-random examples of real "empty" objects. >=20 I=E2=80=99m having difficulty with this, to be honest. I think there are = two reasons for this: 1. I avoid null to the point of going out of my way to make it not = happen - including implementing =E2=80=9CisEmpty=E2=80=9D - = simultaneously I=E2=80=99m having a hard time, which could mean it=E2=80=99= s a solution looking for a problem (was thinking about a file cabinet = with drawers that would accept folders). 2. I have a very specific use case where this would solve a problem for = me. It mainly revolves around the ability in PHP to make an object in = such a way that it =E2=80=9Cfeels=E2=80=9D like an array - and = =E2=80=9Cfeels=E2=80=9D like a string - and can become an integer - but = there=E2=80=99s no way to make the object feel like and be interacted = with like a bool. I don=E2=80=99t want my use case to be the only reason = a change like this is introduced to PHP - I want to make sure =E2=80=9Cit=E2= =80=99s not just me=E2=80=9D - you know?? Re the wiki: I can edit pages now, it doesn=E2=80=99t look like I can = create them. There=E2=80=99s another thread I=E2=80=99ve been watching = and I think I need more karma to make that a thing. I will continue = working on this and if it generates enough pull then maybe I=E2=80=99ll = be let in - I=E2=80=99ll also contribute where I can to start earning = karma. Updated: https://bit.ly/php-0002 Cheers, Josh= --Apple-Mail=_06D56177-374B-4F76-8D59-85DEADE7ACCC--