Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111032 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75772 invoked from network); 15 Jul 2020 22:50:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Jul 2020 22:50:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3E4AB180509 for ; Wed, 15 Jul 2020 14:43:06 -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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_KAM_HTML_FONT_INVALID autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 ; Wed, 15 Jul 2020 14:43:05 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id u12so1957387lff.2 for ; Wed, 15 Jul 2020 14:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LNGleQiC36EN6B784s+E+P1gQB7BlrpCQYR+z4+9mjU=; b=avTHeadQK0+r2gKr9HSTyTk9HF6fD/8TJXDfSFoBhz9uzlpCwCSLGdnIdk3CTUUI2D UFwtZxEKj0rCmqvyUqlvfCkSvgM6iqYi5U4867brEMBu5ql3GpNKj5G1W25hKptSTlnV G6JXSHt8Skszpg9w69i3dbVz6QBStEyJh+F6yTDgFFpVS5goQ9vZ07Nv32qCgc5GObXP ECptXX8RpCAHo4XGAHF/PH96ThO3w4b9W14yPfLOPNP5jyRKL0eiOUO/gZ494utoBJC5 wEgvlVklhMC3w+pfZ1S4BRbd1Nybh6g+9rQZiz31cQWj/h/r72BQTRJVqLRBJWkTwNLD Zfdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LNGleQiC36EN6B784s+E+P1gQB7BlrpCQYR+z4+9mjU=; b=D3OzZgErENWOIz7npy3vaS25LX80EBgm+x+Xzxagpo4+shgecrxyPpM2JKwjSGFiWF vPkSKpea6hTK8hrZ8QunU3EAG5kgIMeMHWF48fXpupskc3hYDps+yg3Nxd+ZQSDHePnV w5YNIIZShCoj5Py6LW7UHhD35bUO4g1RSuhMV401+kBJIzwUiVvUBeT0TDYgcO+RFIU0 tt6+owQ5DxUkQRJXVWy+n4xOUnEtREYrXmgX80hWymWMPw63kHOe5mFYrEuz4METQAmn VuLbmAX5vyYwgSY3rBeJLoQ9N0K3o8zNEzebGM92xIEgSUTYOZCL+W7+aZu8I6IqVSmQ G8KQ== X-Gm-Message-State: AOAM531DMrmL8iY957eBFM4Vq4fFgv5IDr+6PCF2pQU5s7ipPevvbK0/ iVt5ZUUpr/HFvkMdb3ysaEmFZXzmMEM8ylkF7LJspr3Z X-Google-Smtp-Source: ABdhPJw7EM6NZJ7B+DDenF4NSaYJktBRQ7vz3RkPIF1k81f7bkc6/F4JgUQfoM1d+23W9z1OZ94hwRXAUc4D4TG7kYA= X-Received: by 2002:ac2:5443:: with SMTP id d3mr485357lfn.121.1594849383464; Wed, 15 Jul 2020 14:43:03 -0700 (PDT) MIME-Version: 1.0 References: <21C5073D-3F39-49DA-8686-E027AE780793@joshbruce.dev> In-Reply-To: <21C5073D-3F39-49DA-8686-E027AE780793@joshbruce.dev> Date: Wed, 15 Jul 2020 18:42:51 -0300 Message-ID: To: Josh Bruce Cc: php internals Content-Type: multipart/alternative; boundary="000000000000f8c4d605aa81ce77" Subject: Re: [PHP-DEV] [RFC][Discussion] Objects can be declared falsifiable From: marcio.web2@gmail.com (Marcio Almada) --000000000000f8c4d605aa81ce77 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Implement an interface and magic method to allow objects to represent false > (or empty) while still be valid instances of the custom object (type). > > https://wiki.php.net/rfc/objects-can-be-falsifiable < > https://wiki.php.net/rfc/objects-can-be-falsifiable> > > If you saw the latest from this morning, not much has changed except > hopefully improved formatting and now being the official mix of things. > > If this is your first time, the cues are taken from: > > - __toString() > - Stringable > - and __toArray() (not accepted or approved yet) > > Thank you for all the feedback and patience so far, appreciate it! > > If I'm not mistaken, other languages use different methods to express emptiness and falsyness and sometimes these methods have the same implementation sometimes not. So I think it's good that the RFC scope retracted a bit. For instance, in Pyhton it's common to see code like: class test: def __bool__(self): return False __nonzero__=3D__bool__ BTW, I'm not saying you should pursue both RFCs or anything, that's just a reference in case you are looking around how others did it. Ty, M=C3=A1rcio --000000000000f8c4d605aa81ce77--