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; if (version_compare(PHP_VERSION, '5.5.0') >= 0) { echo Bar::class . PHP_EOL; } } } $oBar = new Bar(); } #EOF

preferences:
40.52 ms | 402 KiB | 5 Q