3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class A { abstract public $x { get; } } class C extends A { private $_x; public $x { get => $this->_x; } } var_dump((new ReflectionProperty(C::class, 'x'))->isVirtual()); // should be: bool(true) $c = new C; $c->x = 3; // should throw an error: 'Property C::$x is read-only'
No results found

preferences:
133.36 ms | 992 KiB | 7 Q