3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo\Singleton; class Singleton { /** * The single instance */ private static $instance; /** * Prevent object creation */ private function __construct() {} private function __clone() {} /** * Get Singleton instance */ public static function getInstance() { if(is_null(self::instance)) { self::instance = new Singleton; } return self::instance; } } $singleton = Singleton::getInstance();

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.240.0000.04018.90
5.4.230.0570.03718.76
5.4.220.0030.08318.97
5.4.210.0100.05019.11
5.4.200.0100.06019.05
5.4.190.0070.07019.02
5.4.180.0000.07019.16
5.4.170.0770.04719.20
5.4.160.0100.06018.95
5.4.150.0030.04318.73
5.4.140.0200.06716.42
5.4.130.0030.04316.37
5.4.120.0030.06716.46
5.4.110.0130.07716.24
5.4.100.0000.03716.55
5.4.90.0100.05016.28
5.4.80.0700.05716.18
5.4.70.0030.03316.44
5.4.60.0070.03016.38
5.4.50.0700.05316.38
5.4.40.0070.07316.36
5.4.30.0070.04016.38
5.4.20.0030.04016.38
5.4.10.0100.03016.42
5.4.00.0000.03715.90
5.3.280.0030.07014.68
5.3.270.0000.05314.52
5.3.260.0000.04014.68
5.3.250.1500.04014.51
5.3.240.1070.04014.58
5.3.230.0030.04014.72
5.3.220.0030.03714.59
5.3.210.1330.03714.64
5.3.200.0070.07314.66
5.3.190.0030.04714.51
5.3.180.0000.04014.51
5.3.170.0070.03714.46
5.3.160.0070.04014.55
5.3.150.0070.04014.71
5.3.140.0030.03714.71
5.3.130.0030.04014.70
5.3.120.0700.05014.78
5.3.110.0200.04014.46
5.3.100.0200.04014.02
5.3.90.0170.05314.14
5.3.80.0330.04714.04
5.3.70.0200.04313.93
5.3.60.0100.03714.06
5.3.50.0100.04013.88
5.3.40.0030.03714.06
5.3.30.0070.05314.14
5.3.20.0030.03713.71
5.3.10.0070.03713.66
5.3.00.0000.04013.87

preferences:
139.99 ms | 1394 KiB | 7 Q