Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123354 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id A94781A009C for ; Sat, 18 May 2024 17:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716054181; bh=udpWbWkjenP/Hgl09SdV3grEJcBwmnUttuK9K2FX1To=; h=Date:From:To:Subject:In-Reply-To:References:From; b=kBcgRVkWcG5ibaKV4RbhyLyVlB3GnLDjXHw3Nv5peU3EEIrw5K21wAxRON1HSni8C wzr9qYA1euNVXISjE+XhvsvE5dEz+rjS7QxAfP+p6B9sq9hUvjlq3Hks0Kgm8iq1vx GWgeshfh6HR4djylwDIfapZziZHh49qu+WOhFrdesFKXmG22Gdy/Tj6ly6BFJHq8/t pClnIIHZQEyC0C089Ec+QSsD1vpRLWYb4vKCsCIvXQ4SgVqdMp913f5CYo0473suWc dPr3xJl8kgZDHXmw/SCkFrRW2+2dQHKF8mpPTOzMeq2E69EUi2gZMYdjAt36V1+4fN weXGrtYC714KQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6FB54180081 for ; Sat, 18 May 2024 17:42:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 18 May 2024 17:42:57 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 9BB4F1800106 for ; Sat, 18 May 2024 13:42:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 18 May 2024 13:42:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1716054121; x=1716140521; bh=kEjjakLgw4UQOMyYwzLL5fbOj6hdmABbFyQ4z+T/A/4=; b= 3svxCE/61fWupCz3m1u2wWrsI+ZY/xzfze8wZh+GnVt9PpcHLVrhtfcEKTFy+o3H izBB/xo2ChvJWWk/tM44j/QtK4sBtrFhktPaKKmkG/VmCR0nxIFGm1PLJze6bdC9 tBDJ2Fr74ySNqhHLYCjz6uPg3hTf2N+UfnF1I+/NncZGOa2Oo345L5UYKkqC0vZU sWbPMW+7x1MzyuTE3PssuxvcvSQdogusjNbOAIYCvgICcZzO5WPtFy50lR6olkOg uCe0nsFJMhfnFbZu5dZIep7wvvrZgarbsuRJWyDK+D8yQrMzpjaYdR2Q5Re7KWXK j0L0wiRPFCqlpvZH63N2Qg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716054121; x= 1716140521; bh=kEjjakLgw4UQOMyYwzLL5fbOj6hdmABbFyQ4z+T/A/4=; b=Q qgwcFU+LJYG5fdsh4QDRH38QcpM3Y8nl4HNA+Ohb7H8TqvKPOn8Yur4pIoJFtMXe DLprkoe2mqQgv7lFQ9LnsQ9nywKWnXV7CvAxu7kqnb/ZedxWzOa7+86ERGvsflp9 wR+GHx6TDFcB8ujbpaoP+YRAM49r569IdFtpAQ5t2gzM/0Oz1hkzbwXEMp3rPRoS cFHIUOWRCmIyuT6Ojvld1kuZYvsPlkUSG7qmQ0P2Y9YgDHBNFdEbAJADmBJFnVRW aen3lopXU00jCv81UVw0fnK3kZvmFJvV3TfXDQsf/iaNf6nDnKm9yzBiua71+9cL lxbNREJzYuV1jwtS3KV9g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehiedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgfjghfkfggtgfgsehtqh hmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdf uceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpe ehleffteeigfevudetfedugedtudevledugeeugeelheeihfehgfdtkeevvefgleenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprd hphhhpsehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 18 May 2024 13:42:00 -0400 (EDT) Date: Sat, 18 May 2024 18:41:58 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] [DISCUSSION] Checking uninitialized class properties User-Agent: K-9 Mail for Android In-Reply-To: <5014b401-6341-44c6-a16e-f453ab52220c@app.fastmail.com> References: <878c09ca-860e-4c0c-85ae-2cd0246cda3c@rwec.co.uk> <5014b401-6341-44c6-a16e-f453ab52220c@app.fastmail.com> Message-ID: <47E8FDF4-9805-4A0B-A2E1-55CF8721253E@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 18 May 2024 17:13:49 BST, Larry Garfield wro= te: >However, that breaks down with readonly properties, which are not allowed= to have a sentinel=2E Uninitialized is their sentinel, for better or wors= e=2E Sorry, I don't understand this statement at all=2E A readonly property can= be set to PatchState::KeepCurrentValue just like any other=2E If the inten= tion is that that state will be overwritten with an actual value later, the= n it's not a readonly property=2E=20 I guess you have some different scenario in mind? > And as I noted earlier in the thread, when writing a serializer or other= dynamic systems (an ORM probably would have the same issue), you really ne= ed to be able to differentiate between null and uninitialized=2E Even if y= ou think the uninitialized value is a sign of an error, it's coming from co= de you don't control so you have to be able to handle it somehow=2E If a property is uninitialized, the object is in an invalid state, and att= empting to read that property gives an error=2E That's by design, and as it= should be=2E Are you saying that you want to be able to detect the error before it happ= ens? Why? Rowan Tommins [IMSoP]