Re: [RFC[ Property accessor hooks, take 2
| From: | Larry Garfield | Date: | Mon, 04 Mar 2024 17:20:00 +0000 |
| Subject: | Re: [RFC[ Property accessor hooks, take 2 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122552@lists.php.net to get a copy of this message | ||
On Mon, Mar 4, 2024, at 3:45 PM, Robert Landers wrote:
> I would think that simply using return-to-set would be the simplest
> solution, if you need to run something after it's set, you can use the
> regular way of running code after a return:
>
> try {
> return $value + 100;
> } finally {
> // this runs after returning
> }
That would not work. Fun fact, the finally block runs *before* return. (This is a common point of
confusion.) So this would still not allow for statements to run after the assignment itself (the
return) happens.
--Larry Garfield