Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114643 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8229 invoked from network); 27 May 2021 14:32:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 May 2021 14:32:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 151621804DF for ; Thu, 27 May 2021 07:43:51 -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,FREEMAIL_FROM,NICE_REPLY_A, 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 mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 ; Thu, 27 May 2021 07:43:50 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id z19-20020a7bc7d30000b029017521c1fb75so2791803wmk.0 for ; Thu, 27 May 2021 07:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=m82KsucOodOrjAqKKL9cTR0nxCyjGg3fY1tpdCV+5k0=; b=TcsROHxAqjtkYrVx9RwrZSjP0OlaiC0muvpgRC8I9Xtz1BNRSCqbUae4v5O3iwg6sj TxphbITzFPLvxzz1sxWYRIQCx4G2oi0NqN4W7E8yu2+5v9sedgABxsx9Wg2Ig5l/f5l5 mfiSXPcP1eiXTN+Ha3Z1LIxFxXLrkALgdAyTG/RnIOkzfRKRQXCMNC3wnw6YKEIfxLpo 9LWwR8nhK3UoJu4+C0TXBTR1ISRD20oXnq2QEKGfQPSrBBbUg0DLeSga7JnAIeZ9PXdS 4iClSnIlmdrWeNn2VGQ37omf+FZE2nR+ZYGL6Kacs6Uq+1oQ6Z6bT36NhEPdrVHeVH6V y3hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=m82KsucOodOrjAqKKL9cTR0nxCyjGg3fY1tpdCV+5k0=; b=F/CDWOJaOgV0wK5DpgEVVI9KfGeW6ZDe6+gNgXBdKpcOp7gSNowAopMEOO5+7MouiP VB21AoEp6+k3Ca4cuDF3bWQKf6kmucJYujyfgh9by/BBKeEffTcCXSIVx1Oi8GX9qP2p 6trQsBnr81FktOCNwHZZ3f/VPOXkDdM0kS85D9h/ulnG8XyngmjIaUZG7Aaiw9H0STns 0xH0Qgn4a5U6JLuS/Xm+rzdEpFiVNtbciSvdlTbV8+1+URv6neP8YWqYxv9fh3loBgO5 lMEC6GCvMbWxFDXcP7916bXjuCHGYn2URHNxhksCxdtbZoAXF3C0guBLQ5CJkQB2j9cM 12dQ== X-Gm-Message-State: AOAM530bs+Nvs/XPr+vwKZYYq7II1v1wOpbJFuDjmzegfGzbcgFQruVN Tg3JQEk0cjeIZlvqeOf8xsKnNC6xKcg= X-Google-Smtp-Source: ABdhPJz/1L/YUo13EWb0prjQYbrk06sNdHDfHr3Vnt+Jub8f/qDAayJTHN/iRAEfCWtyq68cVL8Ybw== X-Received: by 2002:a7b:c252:: with SMTP id b18mr3971435wmj.32.1622126627028; Thu, 27 May 2021 07:43:47 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id z12sm4231733wmc.5.2021.05.27.07.43.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 May 2021 07:43:46 -0700 (PDT) To: internals@lists.php.net References: <319c4288-5934-b218-d6eb-0b787a2cdef1@gmx.net> Message-ID: Date: Thu, 27 May 2021 15:43:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <319c4288-5934-b218-d6eb-0b787a2cdef1@gmx.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] Consensus Gathering: is_initialized From: rowan.collins@gmail.com (Rowan Tommins) On 27/05/2021 14:55, Andreas Leathley wrote: > > When using isset on a non-nullable property a > static analyzer would rightfully complain that the property is not > nullable Precisely, so don't mark a property as non-nullable and then leave it unset. > isset in this case is abused to check for uninitialized, hiding the > actual intent On the contrary, the uninitialized state is what is being abused. If you want to make the intent clear, use a clear flag of "needs lazy-loading", or whatever you're actually using this magic "not null but not really anything else either" state for. Regards, -- Rowan Tommins [IMSoP]