3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Example { abstract public string $property { get; } } class ExampleImpl { use Example; public function __construct( public readonly string $property, ) {} }
Output for 8.4.1 - 8.4.11
Fatal error: ExampleImpl and Example define the same hooked property ($property) in the composition of ExampleImpl. Conflict resolution between hooked properties is currently not supported. Class was composed in /in/UYnbo on line 10
Process exited with code 255.
Output for 8.3.0 - 8.3.24
Fatal error: Cannot use the abstract modifier on a property in /in/UYnbo on line 5
Process exited with code 255.
Output for 8.2.0 - 8.2.29
Parse error: syntax error, unexpected token "{", expecting "," or ";" in /in/UYnbo on line 5
Process exited with code 255.

preferences:
169.45 ms | 1074 KiB | 8 Q