Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114626 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25076 invoked from network); 26 May 2021 21:16:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 May 2021 21:16:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8875F1804CC for ; Wed, 26 May 2021 14:27:58 -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,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 mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (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, 26 May 2021 14:27:58 -0700 (PDT) Received: by mail-oi1-f182.google.com with SMTP id v22so2986974oic.2 for ; Wed, 26 May 2021 14:27:58 -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=OEia6X5aSeznbDGzdh1T0w3MA96ce0mh0fJKH43B2EU=; b=sCrGRwFUvi4BXmuWJwuiGXtAHaorFV5bBCX0+PMcQ58BmC2G9vjQepbhmxHPADieN1 hrhjE/gpYrEU5htwnGdGMLLmRUA3gvoQyGBcGcQTmC3XM3qfaJTKKJpGj2wNXNLPp06Q xeE5Kv49cNVZk5qWG+hMP8/aU2XX+YeKjO+YuPEGa126HoRGL8sHLk2NonQz96oa5OcU GDDKO1X5YXZ6EHGa9lQi3xv84S7g9sKZvJMJ3m82FNHUv8nfN00VfXp8LkpUkbXp2W8u 34VPOhLrb9Mq5pQGCX/PtEr9W1S6J/Vj/YmpWvJiQ3AuoZO/4yb+UfW/tLAO82RPDeMa +OKg== 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=OEia6X5aSeznbDGzdh1T0w3MA96ce0mh0fJKH43B2EU=; b=N6PJOTW2StPeIJMMaVKCObBm3AzcCtFw3hVR1iGyY0osvqPXH5xAuXPfB15QcfyaWs 8BbK/0svIYfZS/xBOIHPoieD1ZWXG7wJ1bYbg98nCeN86HKXzrbmGzO6yp5mITtqayu1 5a3utxTlRLLvRaC/h+CD0njjRpKj7RMwiPUWOi8Hum7LRthvZb3/HflLUp6rKALbuEMa n4JIczL0IlnKoay0SO4inWJ+iK1a7hwJe7QfrJjxflMgtP+9WFXaJhMgr8/0FAmdIMnH CD6RV72qh115u+dlU9o/dfvBVL+nWEvwdEko5sZTCdF+U1aH/mapS+ztvD0/oKURFftw 5UEw== X-Gm-Message-State: AOAM530VxsMB7iwGhqGPNKA6iuy1eR3MdYbrPbGbI+Anq09wjBIxWVGT XWOXF/Mi25QpONltMoDxomDylxvzAKli3tOX3+Q= X-Google-Smtp-Source: ABdhPJxdkgajApWihox8UOAWGrBd/n/EkmMSeu7VjXiNnWlugiVVEqMkUHKr3ocmyy8TAUM+Ulj7LYKsSmC+djMEhQM= X-Received: by 2002:a54:458b:: with SMTP id z11mr161733oib.177.1622064476670; Wed, 26 May 2021 14:27:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 26 May 2021 22:27:45 +0100 Message-ID: To: Joe Watkins Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000ef4bb105c34250ca" Subject: Re: [PHP-DEV] Consensus Gathering: is_initialized From: davidgebler@gmail.com (David Gebler) --000000000000ef4bb105c34250ca Content-Type: text/plain; charset="UTF-8" On Wed, May 26, 2021 at 11:14 AM Joe Watkins wrote: > Hi internals, > > In response to: https://bugs.php.net/bug.php?id=78480 > > I implemented: https://github.com/php/php-src/pull/7029 > > Not absolutely convinced that it's a good idea, I asked Nikita to review, > and he's unconvinced also and suggested a discussion should be started. > > I would just like to second (or third, or fourth) the notion that the very possibility of accessing uninitialized state is a bug in the user's code, not a problem for which the language should provide a workaround. If a property is required (i.e. not nullable) it should absolutely and always be initialized in the constructor. I do appreciate PHP being how it is, there might be "valid" use cases for is_initialized() but I also think it will encourage bad practice. Regards Dave --000000000000ef4bb105c34250ca--