3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private function __construct() { } public static function maybe() { return (bool) mt_rand(0, 1); } } $bar = Foo::maybe(); $foo = new Foo();

preferences:
34.97 ms | 402 KiB | 5 Q