Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122453 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 8A5081ACEBF for ; Thu, 22 Feb 2024 12:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708606764; bh=3MRYXvDa2mCiaDtjHNEZxAVG8J++HnqzOWDCyJs7Fug=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Ww6f9W4FhXoH/7FWumKLbGkYMv1CedSOChqXcuR8DCtj0Qi77JKrdk3szDUzNJkxj yVj8dr3hlI84tO9n9zZAz0q3FSgZTnB5Dock30aADXAuhw3AFdCyCtBjuDh7Pt0Wp7 g52D6/esAv104sSEAJzFmR4oi+CG0MxOJI3aE+uy+y2HmwC5tvVwHATsAUleLvgcik Pa6gO1LgM4iqkXIp+oCx3Bmcl+9K3ZcewLRLoFPk5fhL7MwGcfp+2g6uKKZoPH94VO ENVuipcRIauVgLeIkQJWFf1Lz2+bXl43qvfkzlr1FRxkn5R4EdokHCshBAD8GlL6uF qvessxme3erFQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AF4F31801E5 for ; Thu, 22 Feb 2024 12:59:23 +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_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) (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, 22 Feb 2024 04:59:23 -0800 (PST) Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-467570ba746so1352691137.1 for ; Thu, 22 Feb 2024 04:59:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708606757; x=1709211557; 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=4mtbmr7iA2PiORwdS5gYPFDG5xMLoyQRpn7ECwcgjrk=; b=NQK2ijS6gu6DY0yfeJcell9ZHBt5oz1j79pjvkkI2Gx6Q16Nzer79p1GZloyTWbOQb RYjkk7PVM9+LklT+pZcrerDWh1RD0IxqmoLzCoWZe98Z4pkPVcDMCOD8doEMqrwijju/ E8ctDpNygoH5VYpbxeljITVDyihMYhh1FU6AJVlcbYrS9iKd/hYxY/q7e8Hqzg3xCrCN DZ7TGbqTWEVgdciJj5X3iR9VTEUq/zttExIOmIiWb6XTDsI0IRp6QwMnBft8HHeJqa4i 7hgMKtPfPOQ0GNN7AYL3MlnNrUCYeIAdrvA3ABmL3OxhYq695xAE65Kc/NT45fWebvt6 NUfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708606757; x=1709211557; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4mtbmr7iA2PiORwdS5gYPFDG5xMLoyQRpn7ECwcgjrk=; b=r1pzHwivSOQfvvzpWCeIFPt55KH7f8f+mWGBJFe0HpUQIQaVBSOOb+OjI7vzC2//GU fvOlBP0AZD1SW1t2b/hMLjnYpxYIpvppZT0jdJwMF2jAuuIH71Vq5zfHxgQYdsRX+bjm q5BAPJ5fmSDKQN5kPR2ddccfUPKyEZRgrZme5dwHSBoEREqQaFmzAbQr9qbhThrSmrxg fmY8vffbRtQ5/Dp3NYUx2jS0XbUZ2LlRbjJK+lMRF8ga9Cw5YScSE7cFD4zgfsm/LakG Z7kOMAQlMJu+ULLpen73LEABT2BprZKcJTLnqQs1Jff3x6ONFScaCN+kTm7RvNe3OzOd r08A== X-Forwarded-Encrypted: i=1; AJvYcCWc5IZ/NOWv4k4oiWdo0vO42ALvbeGGmEsoIvb2fryn59ZI4xzq1KC832O0KV548rWKWotXhUra08zPof/8TufxEATs6/vMBQ== X-Gm-Message-State: AOJu0YwgeQotTl+ox+Qo6xMmbqF2ndDWS74kFXHib+If/2HjbWNfBpjN Rgnk+WuXTyuogdeVNy1Ba8zr7eUres88635UQ9e6TEkDNd3ujFneTLz46LtVrH9WUnflKF5WvIa 6FyIYUkQlIM+QBAiWrOHm/Pbzehk= X-Google-Smtp-Source: AGHT+IE0n8NRA3L+wDxi7fYf8lfCh17K2lp9VXaw1+vWP3QsIedNYIR1eiHUXTEPlqe1CdcNsupZF9iBMV9rOs6OWYI= X-Received: by 2002:a05:6102:5087:b0:470:535d:cc0b with SMTP id bl7-20020a056102508700b00470535dcc0bmr10510683vsb.2.1708606756768; Thu, 22 Feb 2024 04:59:16 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 22 Feb 2024 09:58:40 -0300 Message-ID: Subject: Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2 To: tag Knife Cc: Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000cc55710611f80264" From: deleugyn@gmail.com (Deleu) --000000000000cc55710611f80264 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 22, 2024 at 8:25=E2=80=AFAM tag Knife wro= te: > A few things i was interested to get the idea around. > Was it thought about for the set{} for it to return the value to set the > property to > instead implicitly setting its own field? > > eg > > ``` > public string $name { > set { > return usfirst($value); > } > } > ``` > Where the value returned in the set is what the property will be set to? > The answer to this question is best described on the RFC FAQ: https://wiki.php.net/rfc/property-hooks#why_do_set_hooks_not_return_the_val= ue_to_set --=20 Marco Deleu --000000000000cc55710611f80264 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Feb 22, 2024 at 8:25=E2=80=AF= AM tag Knife <fenniclog@gmail.com= > wrote:=C2=A0
A few things i was interested to get the idea around.=C2= =A0
Was it thought about for the set{} for it to return the v= alue to set the=20 property=20 to=C2=A0
instead implicitly setting its own field?

<= div>eg

```
public string $name {
=C2=A0= =C2=A0=C2=A0 set {
=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 return us= first($value);
=C2=A0=C2=A0=C2=A0 }
}
```
Where the value returned in the set is what the property will = be set to?

The answer to this question is be= st described on the RFC FAQ:=C2=A0https://wiki.php.ne= t/rfc/property-hooks#why_do_set_hooks_not_return_the_value_to_set
=

--
Marco Deleu
--000000000000cc55710611f80264--