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);
}
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: