3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Singleton { private static $instance = null; final private function __construct() {} final private function __clone() {} public static function getInstance() { if (!self::$instance) { self::$instance = new self; } return self::$instance; } private __invoke() {} } $oneInstance = Singleton::getInstance(); echo "Cloneable outside:", var_dump((new ReflectionClass('Singleton'))->isCloneable()); $cloner = function () { return clone $this; }; $secondInstance = $cloner->bindTo($oneInstance, 'Singleton')->__invoke(); var_dump($oneInstance, $secondInstance);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.250.0060.03712.41
5.4.240.0000.06018.64
5.4.230.0000.08318.96
5.4.220.0000.07018.95
5.4.210.0030.05318.99
5.4.200.0100.07319.00
5.4.190.0070.06018.79
5.4.180.0030.05718.98
5.4.170.0070.07018.95
5.4.160.0130.07018.92
5.4.150.0070.06718.95
5.4.140.0200.03316.55
5.4.130.0130.04716.36
5.4.120.0070.05316.42
5.4.110.0130.04716.51
5.4.100.0130.04716.66
5.4.90.0100.04716.65
5.4.80.0030.05316.53
5.4.70.0100.04716.34
5.4.60.0130.04016.39
5.4.50.0100.05316.50
5.4.40.0070.05016.59
5.4.30.0170.04316.46
5.4.20.0100.04316.29
5.4.10.0100.06316.31
5.4.00.0000.05715.87
5.3.280.0100.05314.78
5.3.270.0070.05314.61
5.3.260.0100.05014.70
5.3.250.0000.06014.44
5.3.240.0100.05014.62
5.3.230.0130.04314.68
5.3.220.0070.07314.79
5.3.210.0130.06314.73
5.3.200.0030.05714.66
5.3.190.0100.05314.48
5.3.180.0130.06714.54
5.3.170.0130.04714.64
5.3.160.0170.05714.55
5.3.150.0070.06014.55
5.3.140.0070.05014.55
5.3.130.0100.06714.64
5.3.120.0130.05014.64
5.3.110.0130.06714.47
5.3.100.0100.05013.94
5.3.90.0070.06313.85
5.3.80.0070.05314.24
5.3.70.0100.05014.25
5.3.60.0070.06014.18
5.3.50.0270.05714.13
5.3.40.0070.06713.95
5.3.30.0130.04313.93
5.3.20.0030.05013.72
5.3.10.0130.04313.67
5.3.00.0070.05313.86

preferences:
143.99 ms | 1394 KiB | 7 Q