Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110966 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74934 invoked from network); 12 Jul 2020 18:43:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Jul 2020 18:43:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 16A9B1804A7 for ; Sun, 12 Jul 2020 10:35:28 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, 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 crocodile.birch.relay.mailchannels.net (crocodile.birch.relay.mailchannels.net [23.83.209.45]) (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 10:35:27 -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 29B0B1E121B; Sun, 12 Jul 2020 17:35:26 +0000 (UTC) Received: from pdx1-sub0-mail-a29.g.dreamhost.com (100-96-23-20.trex.outbound.svc.cluster.local [100.96.23.20]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 508D21E1213; Sun, 12 Jul 2020 17:35:25 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|josh@joshbruce.dev Received: from pdx1-sub0-mail-a29.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); Sun, 12 Jul 2020 17:35:25 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|josh@joshbruce.dev X-MailChannels-Auth-Id: dreamhost X-Bitter-Cellar: 32e5e69a0d040c50_1594575325750_2581680339 X-MC-Loop-Signature: 1594575325750:1274345031 X-MC-Ingress-Time: 1594575325750 Received: from pdx1-sub0-mail-a29.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a29.g.dreamhost.com (Postfix) with ESMTP id EA239B424C; Sun, 12 Jul 2020 10:35:24 -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=W1lQVtTV6Wcyo2lfQP4ZbkLxF 3w=; b=lLpNGyb1hQe3eDikHfssSllcaS9h8HUOqokziHikl6xAmfgESOi39YAhG HI81Y8NQz7qU9e9xoW5wZDdpiZ0pbeHoyyAS7ltZs3lFz+fSVyV3h7WktDTNn5lF bniU2rmFxHN5aoVdVXEXOAncjrgFKuHLauGkVjTJOcVg4qgVb8= 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-a29.g.dreamhost.com (Postfix) with ESMTPSA id 1CCADB423C; Sun, 12 Jul 2020 10:35:23 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a29 Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_72FD6BA7-7CA2-41E7-82C3-E324154CFFF6" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Date: Sun, 12 Jul 2020 12:35:21 -0500 In-Reply-To: Cc: php internals To: Larry Garfield References: <65EE4215-3F80-435C-B271-DBE30D26E2CB@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: gggruggvucftvghtrhhoucdtuddrgeduiedrvdeigdduudejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegoufhushhpvggtthffohhmrghinhculdegledmnecujfgurhephffktgggufffjgfvfhfosegrtdhmrehhtdejnecuhfhrohhmpeflohhshhcuuehruhgtvgcuoehjohhshhesjhhoshhhsghruhgtvgdruggvvheqnecuggftrfgrthhtvghrnhepieegfeevieduveekleffvedvudduvedtkedvjedtgedtudfgjedvueekveevvdegnecuffhomhgrihhnpegsihhtrdhlhienucfkphepudefiedrvdelrddugedtrddvudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehjohhshhhsqdhmsghprdhlrghnpdhinhgvthepudefiedrvdelrddugedtrddvuddprhgvthhurhhnqdhprghthheplfhoshhhuceurhhutggvuceojhhoshhhsehjohhshhgsrhhutggvrdguvghvqedpmhgrihhlfhhrohhmpehjohhshhesjhhoshhhsghruhgtvgdruggvvhdpnhhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth Subject: Re: [PHP-DEV] [CONCEPT][DISCUSSION] Instance as boolean From: josh@joshbruce.dev (Josh Bruce) --Apple-Mail=_72FD6BA7-7CA2-41E7-82C3-E324154CFFF6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 >=20 > Focusing on Bool is, I think, a good choice because it has an argument = for it other than "well it works for strings." You hint at it in the = writeup but really bury the lead: Null objects. >=20 > Being able to not use null or false as a "not found" case and instead = return an "empty" value object is very nice, but then you also want to = know if the value returned is legitimate. An object that could = self-cast to boolean makes something like this viable and type-safe: >=20 >=20 Thanks! I think you=E2=80=99re right - maybe just taking a minute to figure out = what the lead was. lol I updated the repo and link: https://bit.ly/php-0002 = Going to be starting a new thread with subject that matches better where = we are: Objects able to define emptiness (and possibly truthiness by extension = to maintain consistency - but object may be an exception??). Cheers, Josh ps. Also did get registered to the wiki from a different thread = conveniently happening at the same time. :)= --Apple-Mail=_72FD6BA7-7CA2-41E7-82C3-E324154CFFF6--