Re: [RFC] [DISCUSSION] Compact Object Property Assignment
| From: | Marco Pivetta | Date: | Mon, 16 Mar 2020 14:30:54 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Compact Object Property Assignment | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109060@lists.php.net to get a copy of this message | ||
Hey Jakob,
What happens if you have an expression that throws?
class Foo
{
public $a;
public $b;
public $c;
}
$instance = new Foo();
function iThrow() {
throw new \Exception();
}
try {
$foo ->[
a = 'a',
b = iThrow(),
c = 'c',
];
} catch (\Throwable $e) {
var_export($foo); // ???
}
What will the state of
$foo be here?
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On Mon, Mar 16, 2020 at 12:48 PM Jakob Givoni <jakob@givoni.dk> wrote:
> Hello Internals,
>
> I'm opening up my new RFC for discussion:
>
> https://wiki.php.net/rfc/compact-object-property-assignment
> - A pragmatic approach to object literals
>
> Let me know what you think!
>
> Best,
> Jakob
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>