3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Example1 { public string $name = 'asd' { set(string $value) { $this->name = $value; } } } final class Example2 { public string $name = 'asd' { set(string $value) { throw new \Exception('Cannot update value'); $this->name; } } } final class Example3 { // Cannot specify default value for virtual hooked property Example1::$name public string $name = 'asd' { set(string $value) { // $this->name = $value; } } } final class Example4 { // Cannot specify default value for virtual hooked property Example2::$name public string $name = 'asd' { set(string $value) { throw new \Exception('Cannot update value'); } } }
Output for git.master
Fatal error: Cannot specify default value for virtual hooked property Example3::$name in /in/EbvOM on line 28
Process exited with code 255.

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:
143.53 ms | 999 KiB | 7 Q