Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129131 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 lists.php.net (Postfix) with ESMTPS id 4D9071A00BC for ; Fri, 7 Nov 2025 11:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762513425; bh=ZRbIuhUDMzgfb7pLl7Dz7buxjSC7v7RPlJhkUdQIh8Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Bpxbr08kxk9rbRUEBbL7JofF5CvZ3gjt2UMzgA82WTQrCCdAuCJvcgOTMiL6iwi3/ G0GQLstZIPIPEDUdsSeg+kEDayLWogE+OCgw7/RvQGO+nXMbVb8FzLdEDHfNCx5Vh/ 29IVLP5fhikmpsHehGtrqk8IRiAyrccOlFaDhBztGsrZOODZ31rpqDOvXY8RGYZWnN xkn3UBFZoX7ixV3aCz9V220jdonN9vhyT76m4zvO/Jzv+0BxLuCqDyAwxvWb+G1qP5 6Jjp/kiLXRQZ6jeh5+20DuRAniZSbOS19PxttfPhvX5SMitBVTuFa8n2xkgEpd8kCb 6yGvFfdL6KJKw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4023F18002E for ; Fri, 7 Nov 2025 11:03:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Fri, 7 Nov 2025 11:03:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1762513419; bh=Hadn0Pf+qtxEkQUpYK7Z22Xrwc/1giYF+vQkPulhT6s=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=S9KrG8Y5pcu1euWipR6K6OAZ+kXjbSueEk9R5k16/YThxEfJHgRtwy3wU1V1Id0E8 4yTKzeyk1Z4oukA/YA4yo5+CypFTrKjBlqw/Eyr9CU/Cp5eEFIzDFinDsLGLfjpKOy 6OyNHWB58oX39xszoJz2BBgvYrwaek3T22uC/ld9tXHznUyNuVr8Y6hzON9RDkFDDh l0C/ungZFCCkSy4fihbl+Gvvvot+Lj72QCK6MROtgpWJrt/d2+0QPmKS3fYQge7oLs xXras+RvFe3agymZV4rJ0KJXFMY8jsf1J2ktHD7kQyvdDreldn7vWlkO5pvVV0cPDG Xpd3OvWH6TOQg== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 07 Nov 2025 12:03:38 +0100 To: Larry Garfield Cc: php internals Subject: Re: [PHP-DEV] [RFC] isReadable/isWriteable property reflection In-Reply-To: References: Message-ID: <76553cea80282c4b6d71c4ead501415e@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-11-06 00:24, schrieb Larry Garfield: > In other news, Ilija and I said a year ago that we'd take a swing at > adding isReadable/isWriteable methods to ReflectionProperty. Took a > while, but here we are. A strangely small RFC from us: > > https://wiki.php.net/rfc/isreadable-iswriteable I dislike implicitly “scope-dependent” functions, since they effectively act like magic. This probably makes it harder to understand for humans and static analysis tools alike. I would therefore suggest making the `$scope` parameter required. A user can just pass `static::class` themselves and static analysis tools can use `class-string|null` instead of `class-string|"static"|null` as their expected parameter type. As for the magic method logic: I would suggest to ignore the presence of __get() and __set(). This more closely aligns with the direction PHP goes towards and is also easy to work around by checking with `method_exists()` whether any such a method exists - the reverse is not true. Best regards Tim Düsterhus