3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class SomeClass { private protected(set) string $name = 'a'; private private(set) string $other = 'b'; public function __construct( private protected(set) int $promoted, ) { } }
Output for 8.5.10
Fatal error: Visibility of property SomeClass::$name must not be weaker than set visibility in /in/5SltD on line 6 Stack trace: #0 {main}
Process exited with code 255.

preferences:
21.49 ms | 1506 KiB | 6 Q