'a', 'b' => 'b' ), $varQ = 'string', $varR = 123; // Intentionally missing a semi-colon for testing. public $varS, $varT } // Issue #3188 - static as return type. public static function fCreate($attributes = []): static { return static::factory()->create($attributes); } public static function fCreate($attributes = []): ?static { return static::factory()->create($attributes); } // Also account for static used within union types. public function fCreate($attributes = []): object|static { } // Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. $callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; }; class TypedProperties { public int $var; protected string $stringA, $stringB; private bool $boolA, $boolB; } // PHP 8.0 constructor property promotion. class ConstructorPropertyPromotionTest { public function __construct( public $x = 0.0, protected $y = '', private $z = null, $normalParam, ) {} } class ConstructorPropertyPromotionWithTypesTest { public function __construct(protected float|int $x, public ?string &$y = 'test', private mixed $z) {} } // PHP 8.1 readonly keywords. class ReadonlyTest { public readonly int $publicReadonlyProperty; protected readonly int $protectedReadonlyProperty; readonly protected int $protectedReadonlyProperty; readonly private int $privateReadonlyProperty; public function __construct(readonly protected float|int $x, public readonly ?string &$y = 'test') {} }