-
Couldn't load subscription status.
- Fork 8k
Closed as not planned
Description
Description
The following code:
function getUserContext()
{
static $userContext ??= User::load(\Drupal::currentUser()->id());
return $userContext;
}
<?phpResulted in this output:
syntax error, unexpected token "??=", expecting "," or ";"
But I expected this output instead:
Assignation if `$currentUser` is not yet defined.
PHP Version
PHP 8.3.0, PHP 8.4.0
Operating System
All