Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-17 Thread Tim Düsterhus
Hi On 3/17/23 14:32, Ilija Tovilo wrote: Yes, your example makes more sense. In my old example the value of the static variable was already assigned so didn't prove the point it was trying to make. I adjusted the example in the RFC. Okay, I believe that resolves all the remarks I ha(ve|d). Be

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-17 Thread Ilija Tovilo
Hi Tim > Isn't the destructor+exception example misleading? In that case the > initial value of '$x' is constant, thus it should always be known to > reflection, no? > > Should the example look like this: > > > function foo($y) { > > $x = new Foo(); > > static $x = $y; > > } > > > > try {

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-17 Thread Tim Düsterhus
Hi Thank you, I've had another read through the RFC. On 3/16/23 12:51, Ilija Tovilo wrote: Let me know if anything is still unclear. Isn't the destructor+exception example misleading? In that case the initial value of '$x' is constant, thus it should always be known to reflection, no? Sh

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-16 Thread Ilija Tovilo
Hi Alexandru >> https://wiki.php.net/rfc/arbitrary_static_variable_initializers >> https://externals.io/message/118976 >> >> There haven't been many responses, so I'd like to put this to a vote >> early next week. >> > Only a small thing in the example for > "ReflectionFunction::getStaticVariable

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-16 Thread Ilija Tovilo
Hi Tim > Using Alain's example of static variables that depend on each other. For > the following: > > function foo() { >static $a = 0; >static $b = $a + 1; > } > > The value of '$a' is known at compile time. Is the value of '$b' also > known at compile time? It might make sense to include

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-15 Thread Tim Düsterhus
Hi On 3/15/23 18:21, Ilija Tovilo wrote: https://wiki.php.net/rfc/arbitrary_static_variable_initializers https://externals.io/message/118976 There is an unresolved "question": Side note: It's been suggested that expressions that can be evaluated constantly continue to do so. This would mean

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-15 Thread Alexandru Pătrănescu
On Wed, Mar 15, 2023, 14:02 Ilija Tovilo wrote: > Hi everybody > > It's been a while since I've announced this RFC. > https://wiki.php.net/rfc/arbitrary_static_variable_initializers > https://externals.io/message/118976 > > There haven't been many responses, so I'd like to put this to a vote > ea

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-15 Thread Ilija Tovilo
Hi Tim > > https://wiki.php.net/rfc/arbitrary_static_variable_initializers > > https://externals.io/message/118976 > > There is an unresolved "question": > > > Side note: It's been suggested that expressions that can be evaluated > > constantly continue to do so. This would mean that some express

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-15 Thread Ilija Tovilo
Hi Alain > > https://wiki.php.net/rfc/arbitrary_static_variable_initializers > > https://externals.io/message/118976 > > Could I suggest that you make something like the following throw an error: > > function foo($i) { > static $a = $b + 1; > static $b = $i; > } > > You could try to reor

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-15 Thread Tim Düsterhus
Hi On 3/15/23 13:02, Ilija Tovilo wrote: It's been a while since I've announced this RFC. https://wiki.php.net/rfc/arbitrary_static_variable_initializers https://externals.io/message/118976 There haven't been many responses, so I'd like to put this to a vote early next week. There is an unre

Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-15 Thread Alain D D Williams
On Wed, Mar 15, 2023 at 01:02:04PM +0100, Ilija Tovilo wrote: > Hi everybody > > It's been a while since I've announced this RFC. > https://wiki.php.net/rfc/arbitrary_static_variable_initializers > https://externals.io/message/118976 > > There haven't been many responses, so I'd like to put this

[PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers

2023-03-15 Thread Ilija Tovilo
Hi everybody It's been a while since I've announced this RFC. https://wiki.php.net/rfc/arbitrary_static_variable_initializers https://externals.io/message/118976 There haven't been many responses, so I'd like to put this to a vote early next week. Ilija -- PHP Internals - PHP Runtime Developme