3v4l.org

run code in 300+ PHP versions simultaneously
<?php class App { public function run() { echo 'Hello' . PHP_EOL; } } class AppContainer { private static $app = null; public static function getInstance() { if (null === self::$app) { self::$app = self::makeInstance(); } return self::$app; } private static function makeInstance() { $app = new App(); // do all logic for adding routes etc return $app; } } // Whenever you need it $app1 = AppContainer::getInstance(); $app2 = AppContainer::getInstance(); if ($app1 === $app2) { echo 'yay, same object' . PHP_EOL; } $app1->run(); $app2->run();

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.3.60.0180.00316.63
8.3.50.0090.01021.07
8.3.40.0080.00618.80
8.3.30.0120.00318.57
8.3.20.0070.00020.33
8.3.10.0000.00823.46
8.3.00.0090.00021.77
8.2.180.0120.00616.63
8.2.170.0080.00622.96
8.2.160.0030.01320.51
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0060.00320.94
8.2.120.0000.00726.35
8.2.110.0100.00021.00
8.2.100.0080.00417.92
8.2.90.0040.00419.03
8.2.80.0030.00617.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0040.00718.09
8.2.40.0030.00620.44
8.2.30.0030.00319.43
8.2.20.0000.00817.64
8.2.10.0040.00417.99
8.2.00.0080.00018.05
8.1.280.0100.01025.92
8.1.270.0040.00423.90
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0000.01217.38
8.1.230.0110.00017.83
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.00817.23
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0000.00818.53
8.1.160.0040.00420.64
8.1.150.0040.00420.65
8.1.140.0040.00419.36
8.1.130.0030.00317.68
8.1.120.0040.00417.30
8.1.110.0040.00417.23
8.1.100.0030.00617.36
8.1.90.0040.00417.41
8.1.80.0050.00317.42
8.1.70.0040.00417.28
8.1.60.0050.00217.59
8.1.50.0000.00817.42
8.1.40.0040.00417.56
8.1.30.0030.00617.57
8.1.20.0000.00717.49
8.1.10.0000.00817.56
8.1.00.0000.00717.52
8.0.300.0040.00418.77
8.0.290.0080.00016.62
8.0.280.0070.00018.46
8.0.270.0000.00717.26
8.0.260.0030.00317.26
8.0.250.0070.00016.94
8.0.240.0030.00716.92
8.0.230.0040.00416.80
8.0.220.0040.00416.86
8.0.210.0050.00316.80
8.0.200.0030.00316.91
8.0.190.0000.00816.90
8.0.180.0040.00416.84
8.0.170.0040.00416.91
8.0.160.0000.00916.88
8.0.150.0000.00716.66
8.0.140.0000.00716.82
8.0.130.0000.00513.30
8.0.120.0000.00816.78
8.0.110.0020.00516.80
8.0.100.0070.00016.86
8.0.90.0050.00316.84
8.0.80.0080.00816.80
8.0.70.0040.00416.71
8.0.60.0040.00416.71
8.0.50.0070.00016.63
8.0.30.0090.00817.18
8.0.20.0120.00817.40
8.0.10.0040.00416.92
8.0.00.0090.00816.55
7.4.330.0000.00516.79
7.4.320.0030.00316.58
7.4.300.0070.00016.60
7.4.290.0040.00416.52
7.4.280.0080.00016.50
7.4.270.0030.00316.41
7.4.260.0070.00016.49
7.4.250.0050.00316.57
7.4.240.0030.00516.42
7.4.230.0030.00316.42
7.4.220.0040.01516.52
7.4.210.0080.00816.54
7.4.200.0030.00316.70
7.4.160.0080.00816.32
7.4.150.0140.00317.40
7.4.140.0160.00317.86
7.4.130.0120.00816.52
7.4.120.0070.01016.39
7.4.110.0140.00316.41
7.4.100.0070.01416.54
7.4.90.0040.01516.50
7.4.80.0130.00319.39
7.4.70.0070.01316.50
7.4.60.0120.00916.48
7.4.50.0100.00716.40
7.4.40.0100.01416.42
7.4.30.0120.00616.51
7.4.00.0090.00615.15
7.3.330.0050.00013.40
7.3.320.0030.00313.24
7.3.310.0030.00316.27
7.3.300.0070.00016.39
7.3.290.0030.00316.38
7.3.280.0090.01116.34
7.3.270.0140.00417.40
7.3.260.0060.01016.52
7.3.250.0140.00616.43
7.3.240.0070.01016.47
7.3.230.0070.01016.39
7.3.210.0100.00716.67
7.3.200.0080.01119.39
7.3.190.0060.01116.44
7.3.180.0140.00716.66
7.3.170.0080.00816.51
7.3.160.0100.00616.61
7.3.120.0090.00914.86
7.3.110.0000.01714.86
7.3.100.0090.00614.96
7.3.90.0070.00414.79
7.3.80.0060.00815.15
7.3.70.0030.00914.97
7.3.60.0030.00914.88
7.3.50.0060.00914.74
7.3.40.0040.01114.95
7.3.30.0110.00314.82
7.3.20.0030.00916.89
7.3.10.0070.01016.54
7.3.00.0110.00516.71
7.2.330.0110.00816.64
7.2.320.0140.01016.78
7.2.310.0040.01416.84
7.2.300.0070.01016.44
7.2.290.0030.01316.42
7.2.240.0090.00615.29
7.2.230.0100.00614.93
7.2.220.0080.00814.73
7.2.210.0070.00315.05
7.2.200.0070.00715.18
7.2.190.0040.00414.70
7.2.180.0060.00315.25
7.2.170.0030.00615.00
7.2.160.0040.01114.79
7.2.150.0140.00316.89
7.2.140.0030.00917.01
7.2.130.0090.00516.88
7.2.120.0020.01216.88
7.2.110.0060.00616.77
7.2.100.0010.01016.86
7.2.90.0060.00916.83
7.2.80.0080.00716.74
7.2.70.0020.01316.88
7.2.60.0070.00716.76
7.2.50.0050.01216.83
7.2.40.0050.00917.00
7.2.30.0050.01117.04
7.2.20.0030.00916.84
7.2.10.0090.00616.90
7.2.00.0050.00917.62
7.1.330.0070.01015.79
7.1.320.0070.00715.74
7.1.310.0040.01115.93
7.1.300.0070.01015.52
7.1.290.0060.00615.78
7.1.280.0000.01015.53
7.1.270.0040.01115.70
7.1.260.0040.01415.48
7.1.250.0030.00715.85
7.1.200.0030.00615.58
7.1.100.0060.01518.02
7.1.70.0030.00716.86
7.1.60.0100.01419.40
7.1.50.0060.01916.91
7.1.00.0070.09322.47
7.0.200.0350.00714.75
7.0.60.0230.06321.66
7.0.50.0100.06717.86
7.0.40.0070.07320.30
7.0.30.0170.04020.30
7.0.20.0300.06320.24
7.0.10.0100.08020.12
7.0.00.0000.09020.32
5.6.280.0000.03721.13
5.6.210.0000.04720.70
5.6.200.0130.06018.29
5.6.190.0070.09320.61
5.6.180.0270.03320.28
5.6.170.0270.04320.62
5.6.160.0070.08320.57
5.6.150.0030.06718.21
5.6.140.0100.06318.14
5.6.130.0070.08018.28
5.6.120.0070.07020.97
5.6.110.0030.06321.11
5.6.100.0130.05321.01
5.6.90.0070.06720.88
5.6.80.0130.07320.45
5.5.350.0230.04320.39
5.5.340.0000.05318.05
5.5.330.0200.07020.29
5.5.320.0330.03320.36
5.5.310.0270.05320.34
5.5.300.0100.06317.98
5.5.290.0070.07017.96
5.5.280.0100.07720.86
5.5.270.0130.06320.80
5.5.260.0130.07720.85
5.5.250.0070.03720.71
5.5.240.0200.04320.38

preferences:
53.11 ms | 401 KiB | 5 Q