Re: [RFC][Discussion] use construct (Block Scoping)

From: Date: Fri, 12 Dec 2025 07:35:35 +0000
Subject: Re: [RFC][Discussion] use construct (Block Scoping)
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-129592@lists.php.net to get a copy of this message
On 11 December 2025 23:37:06 GMT, Morgan <weedpacket@varteg.nz> wrote: >On 2025-12-12 11:21, Rowan Tommins [IMSoP] wrote: >> function foo() { >>     static $a = 1; // OK >>     static $b = $a; // Fatal error: Constant expression contains invalid operations >> } > >Though this example is legal since 8.3. Oh, I must have had the wrong version selected on 3v4l when I tested it. Thanks for pointing that out. I guess the point stands that we *could* use it, if we really wanted to avoid deciding how ambiguous scope worked. Rowan Tommins [IMSoP]

« previous php.internals (#129592) next »