1--TEST-- 2Constructor promotion (basic example) 3--FILE-- 4<?php 5 6class Point { 7 public function __construct(public int $x, public int $y, public int $z) {} 8} 9 10$point = new Point(1, 2, 3); 11 12// Check that properties really are typed. 13try { 14 $point->x = "foo"; 15} catch (TypeError $e) { 16 echo $e->getMessage(), "\n"; 17} 18 19?> 20--EXPECT-- 21Cannot assign string to property Point::$x of type int 22