3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { class Bar { function __construct(){ echo get_called_class() . PHP_EOL; echo get_class($this) . PHP_EOL; echo __CLASS__ . PHP_EOL; echo get_class(self) . PHP_EOL; echo ClassName::class . PHP_EOL; } } $oBar = new Bar(); } #EOF
Output for git.master, git.master_jit, rfc.property-hooks
Foo\Bar Foo\Bar Foo\Bar Fatal error: Uncaught Error: Undefined constant "Foo\self" in /in/2pYCX:10 Stack trace: #0 /in/2pYCX(15): Foo\Bar->__construct() #1 {main} thrown in /in/2pYCX on line 10
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:
45.16 ms | 401 KiB | 8 Q