Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111843 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62520 invoked from network); 4 Sep 2020 17:58:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Sep 2020 17:58:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 45F0B18053B for ; Fri, 4 Sep 2020 10:03:36 -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.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-mahalux.mvorisek.com (mail-mahalux.mvorisek.com [77.93.195.127]) (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 ; Fri, 4 Sep 2020 10:03:34 -0700 (PDT) Received: from 55068e1b8aab (10.228.0.206) by mail-mahalux.mvorisek.com (10.228.0.4) with Microsoft SMTP Server (TLS); Fri, 4 Sep 2020 19:03:29 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_e8b6ea52dfe9de332c6fa1816a9445e7" Date: Fri, 04 Sep 2020 19:03:29 +0200 To: PHP internals Message-ID: X-Mailer: SAP NetWeaver 7.03 Subject: __isset() and null value From: vorismi3@fel.cvut.cz (=?UTF-8?Q?Michael_Vo=C5=99=C3=AD=C5=A1ek_-_=C4=8CVUT_FEL?=) --=_e8b6ea52dfe9de332c6fa1816a9445e7 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed isset() returns false for null __isset() should return the same, but then if magic property with null value exists, there is no way to detect it Example: https://3v4l.org/GqUsh this is currently an limitation of php Ideally, we should introduce __exist() which should return true even if value is null and for BC autoimplement __isset() based on it and __get, ie. function __isset($n) { return $this->__exist($n) && $this->__isset($n) !== null; } With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek --=_e8b6ea52dfe9de332c6fa1816a9445e7--