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; } } $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)
8.4.20.0070.01317.70
8.4.10.0130.00617.88
8.3.150.0120.00817.10
8.3.140.0040.00720.81
8.3.130.0040.00418.77
8.3.120.0060.00318.99
8.3.110.0040.00720.94
8.3.100.0090.00016.94
8.3.90.0080.00018.61
8.3.80.0060.00317.00
8.3.70.0090.00616.88
8.3.60.0170.00316.63
8.3.50.0100.00721.96
8.3.40.0120.00918.84
8.3.30.0140.00018.91
8.3.20.0000.00820.52
8.3.10.0030.00723.55
8.3.00.0040.00419.80
8.2.260.0090.00916.84
8.2.250.0060.00316.71
8.2.240.0000.01518.88
8.2.230.0040.00422.58
8.2.220.0060.00337.54
8.2.210.0080.00026.77
8.2.200.0060.00316.88
8.2.190.0140.00716.58
8.2.180.0040.01118.14
8.2.170.0000.01522.96
8.2.160.0100.00320.44
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0060.00320.63
8.2.110.0050.00522.13
8.2.100.0060.00617.91
8.2.90.0000.00819.05
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0000.00817.93
8.2.50.0060.00318.07
8.2.40.0000.00718.16
8.2.30.0000.01018.16
8.2.20.0090.00017.70
8.2.10.0020.00518.12
8.2.00.0000.00817.75
8.1.310.0160.00316.73
8.1.300.0090.00617.82
8.1.290.0030.00618.88
8.1.280.0060.00925.92
8.1.270.0070.00023.99
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0000.00823.81
8.1.230.0040.00719.17
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00617.35
8.1.190.0000.00817.13
8.1.180.0040.00418.10
8.1.170.0060.00618.50
8.1.160.0020.00521.91
8.1.150.0030.00518.89
8.1.140.0030.00517.51
8.1.130.0040.00419.14
8.1.120.0000.00717.46
8.1.110.0030.00617.39
8.1.100.0040.00417.46
8.1.90.0030.00417.38
8.1.80.0000.00717.40
8.1.70.0000.00817.45
8.1.60.0040.00417.50
8.1.50.0050.00317.42
8.1.40.0000.00817.58
8.1.30.0000.00817.63
8.1.20.0020.00517.53
8.1.10.0030.00517.54
8.1.00.0060.00317.41
8.0.300.0080.00019.68
8.0.290.0000.00716.63
8.0.280.0030.00318.47
8.0.270.0000.00716.95
8.0.260.0050.00216.90
8.0.250.0040.00417.04
8.0.240.0040.00416.93
8.0.230.0050.00217.02
8.0.220.0070.00016.87
8.0.210.0070.00016.99
8.0.200.0040.00417.04
8.0.190.0080.00016.92
8.0.180.0040.00417.00
8.0.170.0000.00717.07
8.0.160.0050.00217.01
8.0.150.0040.00416.88
8.0.140.0000.00816.85
8.0.130.0060.00013.45
8.0.120.0000.00716.95
8.0.110.0070.00017.01
8.0.100.0040.00416.85
8.0.90.0000.00816.99
8.0.80.0090.01216.90
8.0.70.0040.00416.85
8.0.60.0040.00416.88
8.0.50.0000.00716.86
8.0.30.0040.01317.26
8.0.20.0080.01117.40
8.0.10.0070.00016.97
8.0.00.0130.00616.75
7.4.330.0000.00515.00
7.4.320.0030.00316.48
7.4.300.0030.00316.54
7.4.290.0030.00316.53
7.4.280.0050.00316.51
7.4.270.0050.00316.61
7.4.260.0100.00016.50
7.4.250.0000.00716.63
7.4.240.0050.00216.54
7.4.230.0040.00416.61
7.4.220.0070.01116.55
7.4.210.0030.01116.67
7.4.200.0000.00716.70
7.4.160.0120.01516.59
7.4.150.0100.00717.40
7.4.140.0150.00717.86
7.4.130.0060.01316.60
7.4.120.0060.01116.48
7.4.110.0090.01016.56
7.4.100.0090.00616.37
7.4.90.0030.01416.59
7.4.80.0140.00619.39
7.4.70.0080.01016.41
7.4.60.0060.00916.64
7.4.50.0040.00416.37
7.4.40.0130.00316.61
7.4.30.0080.00816.49
7.4.10.0090.00914.91
7.4.00.0120.00515.06
7.3.330.0000.00513.28
7.3.320.0000.00613.29
7.3.310.0000.00616.21
7.3.300.0000.00716.30
7.3.290.0080.00716.33
7.3.280.0120.00816.29
7.3.270.0070.01017.40
7.3.260.0070.01116.62
7.3.250.0110.00616.32
7.3.240.0070.01716.26
7.3.230.0070.01016.39
7.3.210.0060.01216.63
7.3.200.0070.01119.39
7.3.190.0130.01016.33
7.3.180.0130.00916.23
7.3.170.0070.01016.30
7.3.160.0130.00716.18
7.3.130.0030.00914.81
7.3.120.0060.00815.05
7.3.110.0130.00714.96
7.3.100.0060.00914.72
7.3.90.0060.00915.06
7.3.80.0040.01215.03
7.3.70.0060.01214.55
7.3.60.0030.01014.94
7.3.50.0060.00314.71
7.3.40.0040.01114.87
7.3.30.0060.00614.94
7.3.20.0070.01016.80
7.3.10.0080.00816.46
7.3.00.0070.00416.54
7.2.330.0150.00316.83
7.2.320.0110.00616.93
7.2.310.0080.01116.82
7.2.300.0030.01316.52
7.2.290.0080.01616.47
7.2.260.0140.00715.01
7.2.250.0070.01114.88
7.2.240.0090.00615.28
7.2.230.0030.01315.30
7.2.220.0060.00615.04
7.2.210.0060.00915.35
7.2.200.0040.01115.13
7.2.190.0120.00415.24
7.2.180.0070.00714.87
7.2.170.0110.00414.85
7.2.160.0040.01114.83
7.2.150.0060.00917.09
7.2.140.0070.01016.97
7.2.130.0040.01116.75
7.2.120.0030.01316.90
7.2.110.0030.01016.89
7.2.100.0030.01016.80
7.2.90.0060.00617.15
7.2.80.0060.00316.88
7.2.70.0040.00816.99
7.2.60.0080.00617.07
7.2.50.0040.00416.88
7.2.40.0070.00717.11
7.2.30.0060.00316.76
7.2.20.0040.00816.93
7.2.10.0060.00316.99
7.2.00.0060.00316.92
7.1.330.0050.00515.80
7.1.320.0090.00315.62
7.1.310.0030.01215.57
7.1.300.0040.01115.60
7.1.290.0080.00615.84
7.1.280.0030.01015.91
7.1.270.0070.00315.73
7.1.260.0040.01115.79
7.1.250.0060.00615.81
7.1.240.0070.01115.93
7.1.230.0070.00715.50
7.1.220.0030.00915.54
7.1.210.0050.00515.73
7.1.200.0090.00515.67
7.1.190.0080.00615.56
7.1.180.0070.00415.68
7.1.170.0040.00415.71
7.1.160.0060.00315.75
7.1.150.0030.00515.89
7.1.140.0030.00915.84
7.1.130.0110.00415.82
7.1.120.0000.01115.43
7.1.110.0060.00615.80
7.1.100.0060.00615.73
7.1.90.0040.00715.76
7.1.80.0090.00315.80
7.1.70.0030.01116.30
7.1.60.0070.01217.76
7.1.50.0120.00516.22
7.1.40.0070.00715.71
7.1.30.0000.00915.80
7.1.20.0030.01015.82
7.1.10.0080.00415.85
7.1.00.0070.03819.01
7.0.330.0070.00715.38
7.0.320.0070.00415.23
7.0.310.0040.01115.30
7.0.300.0040.00415.27
7.0.290.0070.00715.38
7.0.280.0040.00415.39
7.0.270.0070.00715.21
7.0.260.0040.00715.45
7.0.250.0030.00915.38
7.0.240.0030.01015.15
7.0.230.0030.01015.46
7.0.220.0030.01015.23
7.0.210.0070.00715.47
7.0.200.0130.00616.13
7.0.190.0060.00315.38
7.0.180.0000.01115.30
7.0.170.0060.00615.38
7.0.160.0000.00815.32
7.0.150.0080.00315.28
7.0.140.0070.03818.63
7.0.130.0040.01015.46
7.0.120.0080.00615.35
7.0.110.0000.01315.46
7.0.100.0000.01515.30
7.0.90.0030.00615.19
7.0.80.0070.00715.20
7.0.70.0060.00615.51
7.0.60.0080.03617.78
7.0.50.0030.04716.70
7.0.40.0050.04216.85
7.0.30.0280.03616.72
7.0.20.0040.03116.82
7.0.10.0170.02516.64
7.0.00.0120.01816.87
5.6.400.0030.00814.39
5.6.390.0060.00914.51
5.6.380.0070.00314.54
5.6.370.0000.01714.57
5.6.360.0030.00914.46
5.6.350.0060.00314.56
5.6.340.0060.00914.27
5.6.330.0030.00714.34
5.6.320.0070.01014.42
5.6.310.0070.01014.31
5.6.300.0070.00714.84
5.6.290.0000.01314.43
5.6.280.0080.04517.81
5.6.270.0040.00814.45
5.6.260.0040.00814.32
5.6.250.0030.00914.09
5.6.240.0070.01014.26
5.6.230.0070.00714.32
5.6.220.0050.00514.33
5.6.210.0070.02017.71
5.6.200.0050.03916.47
5.6.190.0030.04817.38
5.6.180.0170.03217.39
5.6.170.0190.04117.38
5.6.160.0050.03617.30
5.6.150.0100.03316.33
5.6.140.0050.04116.20
5.6.130.0090.02516.23
5.6.120.0100.02017.62
5.6.110.0070.04417.77
5.6.100.0030.04317.77
5.6.90.0090.04117.66
5.6.80.0050.04417.38
5.6.70.0160.03917.26
5.6.60.0070.00414.11
5.6.50.0070.00314.59
5.6.40.0000.01614.46
5.6.30.0060.00914.48
5.6.20.0060.00614.36
5.6.10.0000.00814.27
5.6.00.0030.01014.41
5.5.380.0100.00314.59
5.5.370.0000.00814.30
5.5.360.0080.00813.98
5.5.350.0110.03917.52
5.5.340.0030.02816.22
5.5.330.0040.02617.36
5.5.320.0000.02917.48
5.5.310.0240.03017.53
5.5.300.0100.04316.19
5.5.290.0060.04116.33
5.5.280.0070.02217.58
5.5.270.0050.03117.43
5.5.260.0050.02117.68
5.5.250.0020.02517.44
5.5.240.0100.04217.31
5.5.230.0060.00614.40
5.5.220.0060.00314.36
5.5.210.0100.00014.33
5.5.200.0060.01014.13
5.5.190.0130.00014.15
5.5.180.0070.00713.98
5.5.170.0110.00014.24
5.5.160.0100.00714.33
5.5.150.0040.00814.34
5.5.140.0030.00914.04
5.5.130.0000.01614.33
5.5.120.0030.01014.12
5.5.110.0030.01014.58
5.5.100.0090.00614.18
5.5.90.0130.00314.05
5.5.80.0030.00914.09
5.5.70.0080.00313.84
5.5.60.0070.00714.47
5.5.50.0090.00614.26
5.5.40.0070.00714.09
5.5.30.0110.00314.37
5.5.20.0030.00614.36
5.5.10.0030.00614.46
5.5.00.0070.00714.45
5.4.450.0070.04719.48
5.4.440.0100.07719.18
5.4.430.0070.07319.56
5.4.420.0100.05019.46
5.4.410.0130.06719.34
5.4.400.0070.07718.88
5.4.390.0070.04718.85
5.4.380.0030.08019.14
5.4.370.0070.04319.08
5.4.360.0000.08319.16
5.4.350.0030.04719.08
5.4.340.0070.07718.87
5.4.320.0130.07018.93
5.4.310.0070.05719.20
5.4.300.0100.05018.85
5.4.290.0070.07719.20
5.4.280.0070.08719.11
5.4.270.0030.07319.18
5.4.260.0000.05019.15
5.4.250.0100.05019.07
5.4.240.0030.08019.07
5.4.230.0030.04719.14
5.4.220.0030.08019.07
5.4.210.0130.05019.00
5.4.200.0030.04318.97
5.4.190.0030.04019.19
5.4.180.0030.07019.14
5.4.170.0070.03719.11
5.4.160.0070.07318.96
5.4.150.0070.07719.13
5.4.140.0100.06016.38
5.4.130.0100.03716.33
5.4.120.0130.05716.29
5.4.110.0070.04016.38
5.4.100.0070.07316.46
5.4.90.0170.05016.49
5.4.80.0200.06016.41
5.4.70.0070.07316.65
5.4.60.0030.07716.37
5.4.50.0000.05316.45
5.4.40.0000.07016.38
5.4.30.0030.07716.46
5.4.20.0170.06316.40
5.4.10.0030.08016.50
5.4.00.0130.06015.73
5.3.290.0000.06714.56
5.3.280.0030.07314.76
5.3.270.0100.04314.66
5.3.260.0070.08014.49
5.3.250.0030.06014.65
5.3.240.0100.07714.50
5.3.230.0070.07714.64
5.3.220.0070.07314.60
5.3.210.0100.06014.62
5.3.200.0070.07314.60
5.3.190.0030.06314.57
5.3.180.0030.07714.58
5.3.170.0070.05014.62
5.3.160.0070.06714.46
5.3.150.0030.05014.73
5.3.140.0100.05314.62
5.3.130.0070.07714.71
5.3.120.0030.08314.57
5.3.110.0030.07314.55
5.3.100.0070.06714.09
5.3.90.0000.04014.02
5.3.80.0070.06314.00
5.3.70.0070.03314.04
5.3.60.0000.04013.90
5.3.50.0070.06313.97
5.3.40.0070.03313.90
5.3.30.0070.03313.91
5.3.20.0030.03713.85
5.3.10.0000.03713.65
5.3.00.0000.03713.65
5.2.170.0000.03311.19
5.2.160.0000.03011.20
5.2.150.0000.03011.30
5.2.140.0000.03711.16
5.2.130.0070.02311.11
5.2.120.0070.02311.00
5.2.110.0000.03011.11
5.2.100.0000.03011.16
5.2.90.0030.02711.17
5.2.80.0000.03311.16
5.2.70.0100.03011.03
5.2.60.0000.03011.05
5.2.50.0000.03311.06
5.2.40.0000.03011.06
5.2.30.0000.03011.12
5.2.20.0030.03711.04
5.2.10.0000.03010.89
5.2.00.0000.03310.70
5.1.60.0030.02310.08
5.1.50.0030.02310.02
5.1.40.0030.0239.96
5.1.30.0030.02710.34
5.1.20.0000.02710.35
5.1.10.0000.02710.06
5.1.00.0070.02010.04
5.0.50.0000.0209.07
5.0.40.0000.0209.07
5.0.30.0030.0279.07
5.0.20.0000.0209.07
5.0.10.0000.0209.07
5.0.00.0030.0279.07
4.4.90.0000.0179.07
4.4.80.0030.0139.07
4.4.70.0000.0179.07
4.4.60.0000.0339.07
4.4.50.0000.0239.07
4.4.40.0100.0179.07
4.4.30.0000.0179.07
4.4.20.0000.0179.07
4.4.10.0000.0179.07
4.4.00.0000.0239.07
4.3.110.0000.0179.07
4.3.100.0000.0139.07
4.3.90.0000.0179.07
4.3.80.0000.0239.07
4.3.70.0000.0139.07
4.3.60.0000.0139.07
4.3.50.0000.0139.07
4.3.40.0000.0239.07
4.3.30.0000.0179.07
4.3.20.0000.0139.07
4.3.10.0030.0139.07
4.3.00.0000.0179.07

preferences:
79.66 ms | 403 KiB | 5 Q