Skip to content

Arbitrary static variable initializers #162

Closed
@thekid

Description

@thekid

Support https://wiki.php.net/rfc/arbitrary_static_variable_initializers natively in PHP 8.3 emitter.


Currently, this functionality is emulated by using the following, see implementation status:

use util\Date;

// What gets written
function start() {
  static $now= new Date();

  var_dump($now);
}

// What is emitted
function start() {
  static $now; $now??= new Date();

  var_dump($now);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions