3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; const Bar = 'const'; class Bar { private const BAR = 'class'; public function show(): \Closure { return static function() { echo self::BAR; }; } } (new Bar)->show()();
Output for 8.0.1 - 8.0.27, 8.1.0 - 8.1.14, 8.2.0 - 8.2.1
class

preferences:
17.27 ms | 406 KiB | 5 Q