You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example 7 says that static $int = sqrt(121); is wrong. This has not been updated for 8.3, which allows static variables to be initialised with arbitrary expressions.
There is also a Note: slightly further down that states that " Static declarations are resolved in compile-time." My understanding (which isn't certain enough to be writing the necessary docs) is that the declarations are now resolved the first time the function is executed (and if the expression defining the value recurses on the function call itself, the first time the expression completely evaluates provides the value).
The text was updated successfully, but these errors were encountered:
From manual page: https://php.net/language.variables.scope
Example 7 says that
static $int = sqrt(121);
is wrong. This has not been updated for 8.3, which allows static variables to be initialised with arbitrary expressions.There is also a Note: slightly further down that states that " Static declarations are resolved in compile-time." My understanding (which isn't certain enough to be writing the necessary docs) is that the declarations are now resolved the first time the function is executed (and if the expression defining the value recurses on the function call itself, the first time the expression completely evaluates provides the value).
The text was updated successfully, but these errors were encountered: