Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122473 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 EF6AD1ACEBF for ; Thu, 22 Feb 2024 19:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708630761; bh=ePfYaRajBc/95wySdlA54YjoENgabCJdphfC1ePII7c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=M1ngeayNAzcvQwSgM7FK3AC43S8dPCGVINox5RIhJURywNhiCA4wgG0zbrwgNuliS 1RTNBKtchiL/idsokZyE9rDTZHlPo0fnpl++Wd62Gd/ywqONJFAfTaBsivS1hPSK1n aPneeCTujHC0NjCnb/qU8M0GwSsgQ1LM+IPGhVOUr0p2jDA+RgzraIzHzO5aOkyU7H bVEskpEgjZVmEa3yek2qJxukZmyVyakLIwapEWdpgYIGpOOKmeibVPOHlIMfIlhzqW b6KZ6lXkLkkcGjInUvi7xtdJidSpAIMQOHxWV33x8gnj1mtCzno9oaGFUPnewyD8ZS cKzTGf3OoLW0w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 88D7B1808EC for ; Thu, 22 Feb 2024 19:39:20 +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.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, 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 chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 22 Feb 2024 11:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1708630753; bh=Y2B5lJceYsjqpjXWASgouVGB1wKJTmQIwcfwjkY5fys=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=VOPGB9Erk3/cHSxMbJHiB9YmIUYqq1AwI7rFaM1fi5fYFa3K4AHr4Ax/HwGUUyA/7 Gs97mk94rhC6N/K7c0aEamFwkusR+utP1OcDYTCNgcgxIRHu7dBBff7O2hsW44J/JI JkOoXpbK/qDhv+8g0WLWKQLcrzo45kXoGCelXABv/1/qGnQ0Rr1cISqw0H4M7cgiEX x4PsTzL3wYukU5iwbl+Wmv1eUAm+cyzCb5agHq4edKex8G12fxrSDSHZdZRR6wn4wE A8gUiR7Wcy3Cy5MsGhMBltQdTZGhbvJ88l2h+bqPo4aBw45v79YeEAw+IJqO69dt0l JvNBn7OuUI7Bw== Message-ID: <6a5b02ff-edac-4887-8908-66c7c8855d47@bastelstu.be> Date: Thu, 22 Feb 2024 20:39:11 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2 Content-Language: en-US To: Matthew Weier O'Phinney , Larry Garfield Cc: php internals References: In-Reply-To: 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 On 2/22/24 00:02, Matthew Weier O'Phinney wrote: > Once again in reading the proposal, the first thing I'm struck by are the > magic "$field" and "$value" variables inside accessors. The first time they > are used, they're used without explanation, and they're jarring. > > […] > > Second: you don't have examples of defining BOTH get and set OTHER than > when using expressions for both accessors or a mix. I'm actually unclear > what the syntax is when both are defined. Is there supposed to be a `;` > terminating each? Or a `,`? Or just an empty line? Again, this is one of > the more common scenarios. It needs to be covered early, and clearly. > On a similar topic with regard to syntax and shorthands, I'd like to quote myself from my previous year's email (Message-ID: 17d7983b-68b7-e273-a445-f8399c2510cc@bastelstu.be, https://externals.io/message/120213#120216): > (5) I strongly dislike the doubly abbreviated form of public string $fullName => $this->first . " " . $this->last;. Having just the extra > '>' in there to distinguish it from a regular property feels non-obvious. It's always possible to follow-up with syntax that allows for additional brevity, the inverse is not true and I believe for such a semantically complex feature, having clear and syntax syntax would be beneficial. Best regards Tim Düsterhus