Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129548 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 9C3491A00BC for ; Thu, 4 Dec 2025 14:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764857917; bh=C2PYeVPCgKbqpZ5xxnMzmLOHpmLfCf1PEAkFIJ1V4No=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fJM1Im2dcEZsBPruaISfWDrxnfIFI6pV8Hg87FOX629y7jQYN69dZeurkKDoG40GI L4k7Qig4tzvEsKckMflBQFILgTbWjUh8EK3q5oTDBYZ2SIYDHynkIE2wsgjOAD7JEI e0LmmWX0CS4ETaqK3K3Mv0ZEC+TmmfcN82paG3cpZ+FlZ7PozlHIuPFpq12XGXJ7hg 2VgR5/E7aRRWEBtmxYmETxpcfGgQHzmsnyuxLPjCfqCziWNbhk/9/3xDOrbjmEUHbA JNUX7W1rA4ahZAttbFm/BXIXqsmlK373nargUyEMxroy6dU1eMWvgs+3bRfFXiOnJE SYFbtMlW0csRQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 30EB9180077 for ; Thu, 4 Dec 2025 14:18:33 +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=1.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 ; Thu, 4 Dec 2025 14:18:32 +0000 (UTC) Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-8b220ddc189so104105385a.0 for ; Thu, 04 Dec 2025 06:18:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764857907; x=1765462707; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZjjfhuaUYVYocP7uVJzBePHFYY/ylfS/mGaeqXl1j78=; b=cLXIgLB9qBPG9GPAs9Ky6OaNcyROUddYcOrODLogRRsx/t0YkWIYGMfef4ta8YXtbd DOnzb6ie5Iggn4d2QcPqoXG3cMGvLBUoKS2WFTlA3/++D9niZKs60fKvQRRbw/dh2S4a yFlsqIxRKn4vYvgwhIS158qtkJvyIkH985Gj54EYIQZ3KLvmM8sh3Uf5AV5jn1AoOo1p m8xbuACKaIA8j/iCfIFwMU+8D9dqWtC6pfXsvZ/arABDma6nlJitH1LZSX3RvGu5xlH8 tQ52F7ypt3xD3Ch0H2ApT7DRvi0XaTUUHQO5S0hBCJHJS4b9Ygm1xyqnQHtJQjGqoQnY v+Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764857907; x=1765462707; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZjjfhuaUYVYocP7uVJzBePHFYY/ylfS/mGaeqXl1j78=; b=iTV7BEaHvtoh3cDLQ44HF2p4dwvMtxP3KP+cCiDfX0/m2AaeoQHhHmV+l/c3oKqLWF 1cu+qHtVxy7HTpBRb3uvQvJur82eYTt1zZKJnpdF3k6tbh7RM+DpY8Ty/alruQw6TSKA 0ssQQo4ctvQEIaqky8CaaWogoCZ/0SRer2lYyOMCj3lpYyLAwo18gPZzKROu60d6I6h6 y7Dp64KE7KmlOdrvmYAh37j98lUTqWy1uIqlB4N1jvBb14WT5H+gDlDLg92Cbk10fA28 NCGCGrVh9Qy58/HpcVk0DSAOeo775AIWjjjjZ6ztJaKtRKXmKvbYkh6y4X/AyPXvpTpW pBVA== X-Gm-Message-State: AOJu0YxYWImahAJKwMNVvz1/4xN0UtHjFcK1K4lUN9mMbNhWQCeJsV+G 51EX/gqe9svL4zuO45S8ROCCsjlMwaC5yXt6KvpI6XTbi3ycQEZ6lDxRcyNQkpiQ4qiu88j1yVe y2wJ/FzKxTxWSnEfwRHyhK3fNlvFzcPyUFbjCPaQ= X-Gm-Gg: ASbGncsp4HBXMa0p/+cnmtE4vqbBolKm3/jo6XdWVpgKmj7y2VLlEGW6ShElZ1/SX93 fuxzWK43zalAHx7RlmWlWtWvB0GXH39z/538RT+6ATi3jDQ+HF89XAjKsCXNVSq5t5Niq53l3Gs yiwNYwuyiUmAWbttTM+xXSXy01pWYk2/+FW1J8Vm8duYrXvnfdbcKNlfUOIwvL4RsoDSYEgIGG5 OVTUfQJj6oKGgNG3Dpf/G0loLMqyCGzC1pE5MTlKpmcD4cZvKuuxRchSL0j6UPxcj26Bpy4aGsK vTHt+4kCnVrNYpn/wy0JEdgN8zjOVTXrm5sKhGt5ET2EmIZ5+lEhDHv7wp5Kof1NdeK0BA== X-Google-Smtp-Source: AGHT+IGwjjwoE4mQnI6QBLS90TbYCDpFtdqpO5Mwnu5ysbideDDPVHA0DOjarhaVxo5Y7jrFH6e7D7ls15Ur4FVMUhk= X-Received: by 2002:a05:620a:410d:b0:8b1:ed55:e4f0 with SMTP id af79cd13be357-8b5e535fb77mr884223485a.39.1764857907141; Thu, 04 Dec 2025 06:18:27 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 4 Dec 2025 15:18:15 +0100 X-Gm-Features: AWmQ_blNx1Sh7OBfVRsFAbdUxlaC2xwFv_vtVnW5OYEYuybm4yGoVZI5fwMmgS8 Message-ID: Subject: Re: [PHP-DEV] [RFC] isReadable/isWriteable property reflection To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000a25e7c06452100f0" From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000a25e7c06452100f0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry, typo: I also think the auto-scope is a *not* good idea Le jeu. 4 d=C3=A9c. 2025 =C3=A0 15:05, Nicolas Grekas a =C3=A9crit : > > Le jeu. 6 nov. 2025 =C3=A0 00:28, Larry Garfield = a > =C3=A9crit : > >> 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 whi= le, >> but here we are. A strangely small RFC from us: >> >> https://wiki.php.net/rfc/isreadable-iswriteable >> >> > > Thanks for this. > I also think the auto-scope is a good idea. You state that 90% of use > cases will need this but my experience doesn't back this claim. The only > cases where I had to check for read/writeable were out of the local scope= , > so I'd say 100% of my experience goes against that 90% number ;) Joke > aside, it'd be just fine to let ppl be explicit. That's better than "oops= I > forgot to give the correct scope" bugs. > > About magic methods, one unsets a property only to have __get/__set > called. Existing code works with this assumption. This means we have to > return true IMHO. Magic methods are just generic hooks also. Which means > they should behave the same. > > Nicolas > --000000000000a25e7c06452100f0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry, typo:

I also think the auto-scop= e is a *not* good idea

Le=C2=A0jeu. 4 d=C3=A9c. = 2025 =C3=A0=C2=A015:05, Nicolas Grekas <nicolas.grekas+php@gmail.com> a =C3=A9crit=C2=A0:<= br>

Le=C2=A0jeu. 6 nov. 2025 =C3=A0=C2=A000:28, Larry Garfiel= d <larry@gar= fieldtech.com> a =C3=A9crit=C2=A0:
In other news, Ilija and I said a year ago that w= e'd take a swing at adding isReadable/isWriteable methods to Reflection= Property.=C2=A0 Took a while, but here we are.=C2=A0 A strangely small RFC = from us:

https://wiki.php.net/rfc/isreadable-iswriteable


Thanks for this.
I a= lso think the auto-scope is a good idea. You state that 90% of use cases wi= ll need this but my experience doesn't back this claim. The only cases = where I had to check for read/writeable=C2=A0were out of the local scope, s= o I'd say 100% of my experience goes against that 90% number ;) Joke as= ide, it'd be just fine to let ppl be explicit. That's better than &= quot;oops I forgot to give the correct scope" bugs.

About magic methods, one unsets a property=C2=A0only to have __get/_= _set called. Existing code works with this assumption. This means we have t= o return true IMHO. Magic methods are just generic hooks also. Which means = they should behave the same.

Nicolas
--000000000000a25e7c06452100f0--