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'
Output for git.master
bool(true) Fatal error: Uncaught Error: Property C::$x is read-only in /in/fuj6p:17 Stack trace: #0 {main} thrown in /in/fuj6p on line 17
Process exited with code 255.
Output for rfc.property-hooks
bool(false)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
133.86 ms | 996 KiB | 7 Q