Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111848 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 52095 invoked from network); 5 Sep 2020 21:38:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Sep 2020 21:38:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D09631804D8 for ; Sat, 5 Sep 2020 13:44:00 -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.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_SBL_CSS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 ; Sat, 5 Sep 2020 13:44:00 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id g4so10790353wrs.5 for ; Sat, 05 Sep 2020 13:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=2v96F1iT1mzgLDsswUQNgBkYfnl4pi/B2F0X26Hk9as=; b=G2/q3jKxuSlI7h2i5hDkvJN8v1KbiWxS1zRuFjPCpp0ksr00iSNElf3unk3nlNElfr 89zwbJb6rVZVFP9Fl+hqlRe0txAsK6rwb3p6a9BgHPsGHvYNv+VJQRaEuEM0pjUPfQ3V r7kEyNoy7MUkFtaUNXHFDWY7xEBJ4AhTLSB8PrAhR63qShkYjr0OK+3y8VDK4EEH6IOO MiV9OpWW765ZKRVVAVYDnOmH4hE6tS55zQ/ppRmzGa3PCmZPSmlhba/bhNKNRICG4MyV ikhdVYQcj9G8lb/7M5IhUAjapYQmxz0aZJkJdxoGX7BqtLJbME+K1jbjNuKYYiyCb1cv +i3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=2v96F1iT1mzgLDsswUQNgBkYfnl4pi/B2F0X26Hk9as=; b=bSFVvkP3WPGaicbc7/RDgZrNhotizLvvJSmWnfrEJCqHsN9KGxOBgro316cnYWiBiL AmW8fB9Swba2HRVGqAoTWW2eg8QatemKBKAASRDdy+raDTCClmNbG/K6gIu6AXCtMnHq hbCwPEJK63lWmar98XU2+74ofMsFaTd6++6U42HQ4tSCZuXErQAeeXsbTkYS4SWH6ocd LbTb0M40XQOUFq57ELJ3DrXscyLFa8WaHpu05cDYkQE0Ol/6B5B7A0DVMeujzTPzb690 aPeZ5fi701Kzh7Och0xLTpWxtzKhfwDuTWWtD+aXpNWRO2vgn1qLny27TgZQUTnj88Ws Uoug== X-Gm-Message-State: AOAM530H8VRFfLLXVAtbQ0TpomSgqthbfrAZF0Cw5eoG/YD7odtlKxxU /YdAKxxCqe840gBLH7Mv+QthLVfrwDA= X-Google-Smtp-Source: ABdhPJyOE3+plNMZRQHcrhvAFq8ZZ7A4jQE7kJ5rJuWDy4qk3oyTpvAfrr0JZYR4nfgvgKhCYR/Cmg== X-Received: by 2002:adf:e690:: with SMTP id r16mr9717991wrm.15.1599338638563; Sat, 05 Sep 2020 13:43:58 -0700 (PDT) Received: from [10.134.51.88] (92.40.173.129.threembb.co.uk. [92.40.173.129]) by smtp.gmail.com with ESMTPSA id h8sm19189979wrw.68.2020.09.05.13.43.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Sep 2020 13:43:57 -0700 (PDT) Date: Sat, 05 Sep 2020 21:44:01 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----WKI6TIN6OWNH3L42H9XS4IVGMVW11P" Content-Transfer-Encoding: 7bit To: internals@lists.php.net Message-ID: <541FC73F-CC0C-413F-ACD4-08A8EDF1E1C1@gmail.com> Subject: Re: [PHP-DEV] __isset() and null value From: rowan.collins@gmail.com (Rowan Tommins) ------WKI6TIN6OWNH3L42H9XS4IVGMVW11P Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Michael, On 4 September 2020 18:03:29 BST, "Michael Vo=C5=99=C3=AD=C5=A1ek - =C4=8C= VUT FEL" wrote: >Ideally, we should introduce __exist() which should return true even if >value is null Magic methods in PHP allow the user to overload some built-in operator or = behaviour, so it doesn't make sense to talk about a new magic method in ter= ms of how users are expected to implement it without first describing what = built-in functionality it overloads=2E Is the idea that $foo->__exists($bar) would be called when running propert= y_exists($foo, $bar)? If so I suspect most cases would be clearer if they used some context-spec= ific interface with a well-named method=2E For instance: interface SomeORM\DynamicDBModel { public function hasColumn($columnName): bool; } A notable difference from __isset is that you can write isset($foo->bar) w= ithout having 'bar' as a string value, which AFAIK is not possible with "ex= ists"=2E Regards, --=20 Rowan Tommins [IMSoP] ------WKI6TIN6OWNH3L42H9XS4IVGMVW11P--