New In Initializers

It is possible to use a new expression for default values of static variables, arguments and properties.

<?php

function headers($a = new B()) : B {
    return $a;
}

?>

Documentation

Added in PHP 8.1+