3v4l.org

run code in 300+ PHP versions simultaneously
<?php $anonymous = new class { public function echoMsg(): void { echo 'Hello World' . PHP_EOL; } }; class_alias(get_class($anonymous), 'IHaveName'); class ExtendAnonymous extends IHaveName { } $instance = new ExtendAnonymous(); $instance->echoMsg(); var_dump($instance); var_dump(get_class($instance)); var_dump($instance instanceof $anonymous);
Output for git.master, git.master_jit, rfc.property-hooks
Hello World object(ExtendAnonymous)#2 (0) { } string(15) "ExtendAnonymous" bool(true)

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:
122.09 ms | 405 KiB | 5 Q