3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Route { protected $path; public function __construct($path) { $this->path = $path; } } $routes = array(); $start = microtime(true); for($x = 0; $x < 100; $x++) { $routes[] = new Route("/a"); } echo sprintf("Class: Took %f ms\n", (microtime(true) - $start)); $routes2 = array(); $start = microtime(true); for($x = 0; $x < 100; $x++) { $routes2[] = (object)array( 'path' => '/a' ); } echo sprintf("stdClass: Took %f ms\n", (microtime(true) - $start)); $routes3 = array(); $start = microtime(true); for($x = 0; $x < 100; $x++) { $routes3[] = array( 'path' => '/a' ); } echo sprintf("array: Took %f ms\n", (microtime(true) - $start));

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)
7.4.10.0090.00616.54
7.4.00.0090.00316.56
7.3.130.0000.01716.48
7.3.120.0100.00616.42
7.3.110.0090.00916.43
7.3.100.0060.00616.64
7.3.90.0030.01016.61
7.3.80.0060.00916.48
7.3.70.0070.00716.56
7.3.60.0040.00416.36
7.3.50.0030.01016.38
7.3.40.0100.00016.34
7.3.30.0070.00716.48
7.3.20.0040.01118.14
7.3.10.0080.00018.00
7.3.00.0070.01018.12
7.2.260.0030.01416.56
7.2.250.0060.01216.64
7.2.240.0040.01116.52
7.2.230.0080.00416.45
7.2.220.0040.01116.69
7.2.210.0040.01216.59
7.2.200.0030.01016.64
7.2.190.0000.00816.70
7.2.180.0090.00616.67
7.2.170.0000.01416.60
7.2.160.0100.00316.58
7.2.150.0090.00618.55
7.2.140.0080.00618.50
7.2.130.0060.00918.37
7.2.120.0100.00718.54
7.2.110.0000.01118.57
7.2.100.0100.00318.20
7.2.90.0060.00918.36
7.2.80.0050.00618.29
7.2.70.0070.00718.43
7.2.60.0110.00318.39
7.2.50.0100.00318.47
7.2.40.0030.00918.34
7.2.30.0070.00718.30
7.2.20.0080.00418.44
7.2.10.0060.00618.37
7.2.00.0110.00918.85
7.1.330.0060.00917.25
7.1.320.0000.01017.47
7.1.310.0030.01017.35
7.1.300.0000.00917.28
7.1.290.0030.01017.52
7.1.280.0080.00817.36
7.1.270.0030.00717.43
7.1.260.0070.01017.41
7.1.250.0030.00917.15
7.1.240.0090.00317.11
7.1.230.0050.00517.43
7.1.220.0060.01217.43
7.1.210.0070.00417.38
7.1.200.0000.01017.41
7.1.190.0060.00917.27
7.1.180.0000.00817.21
7.1.170.0030.01017.33
7.1.160.0110.00317.13
7.1.150.0030.01217.40
7.1.140.0060.00617.16
7.1.130.0030.00917.46
7.1.120.0060.00917.39
7.1.110.0070.00717.43
7.1.100.0000.01417.40
7.1.90.0060.00617.46
7.1.80.0040.01117.46
7.1.70.0080.00717.24
7.1.60.0050.01318.51
7.1.50.0130.00617.25
7.1.40.0040.01117.34
7.1.30.0000.01317.38
7.1.20.0070.00717.41
7.1.10.0090.00917.31
7.1.00.0050.03919.77
7.0.330.0000.01317.18
7.0.320.0000.00917.04
7.0.310.0080.00617.18
7.0.300.0030.01217.09
7.0.290.0030.00617.02
7.0.280.0030.01017.04
7.0.270.0120.00316.97
7.0.260.0030.00916.86
7.0.250.0000.01416.92
7.0.240.0060.00617.02
7.0.230.0090.00616.97
7.0.220.0140.00317.04
7.0.210.0040.00817.11
7.0.200.0140.00516.98
7.0.190.0030.01317.05
7.0.180.0100.00017.11
7.0.170.0050.00317.14
7.0.160.0070.00717.25
7.0.150.0150.00017.21
7.0.140.0000.04219.50
7.0.130.0030.01317.08
7.0.120.0090.00317.07
7.0.110.0030.01017.11
7.0.100.0060.00917.05
7.0.90.0060.00616.99
7.0.80.0040.00817.18
7.0.70.0100.00717.00
7.0.60.0120.02318.62
7.0.50.0030.02917.41
7.0.40.0050.04217.66
7.0.30.0090.02617.61
7.0.20.0270.03517.65
7.0.10.0160.04117.53
7.0.00.0040.04117.58
5.6.400.0080.00316.34
5.6.390.0030.01016.15
5.6.380.0030.01216.23
5.6.370.0040.00816.38
5.6.360.0030.00915.97
5.6.350.0040.01216.19
5.6.340.0030.01316.00
5.6.330.0030.00916.23
5.6.320.0030.01015.91
5.6.310.0000.01416.25
5.6.300.0070.01016.28
5.6.290.0030.00616.22
5.6.280.0030.05318.48
5.6.270.0030.00616.11
5.6.260.0090.00615.95
5.6.250.0030.01016.01
5.6.240.0090.00616.16
5.6.230.0000.01415.96
5.6.220.0090.00615.94
5.6.210.0080.04518.47
5.6.200.0060.04517.08
5.6.190.0090.03118.44
5.6.180.0150.04018.29
5.6.170.0200.03418.34
5.6.160.0050.03018.44
5.6.150.0050.04517.16
5.6.140.0020.02617.13
5.6.130.0020.04017.25
5.6.120.0050.04618.55
5.6.110.0070.03818.60
5.6.100.0150.04018.61
5.6.90.0050.04518.61
5.6.80.0080.04018.25
5.6.70.0170.03718.26
5.6.60.0030.01015.91
5.6.50.0030.01416.07
5.6.40.0040.00415.80
5.6.30.0060.01016.04
5.6.20.0080.00415.73
5.6.10.0030.00616.24
5.6.00.0040.01415.98
5.5.380.0080.00616.03
5.5.370.0060.00316.28
5.5.360.0060.00316.08
5.5.350.0130.04018.26
5.5.340.0090.02716.95
5.5.330.0100.02718.23
5.5.320.0030.03118.26
5.5.310.0180.04518.29
5.5.300.0050.02517.03
5.5.290.0060.04317.11
5.5.280.0060.03118.66
5.5.270.0070.04418.47
5.5.260.0100.02218.45
5.5.250.0040.04418.31
5.5.240.0060.02518.21
5.5.230.0040.00715.95
5.5.220.0030.01315.89
5.5.210.0060.00616.02
5.5.200.0030.00615.96
5.5.190.0030.01015.95
5.5.180.0100.00315.84
5.5.170.0070.00716.05
5.5.160.0040.01115.93
5.5.150.0000.01116.21
5.5.140.0070.01016.11
5.5.130.0070.00316.09
5.5.120.0100.00316.07
5.5.110.0000.01515.96
5.5.100.0080.00415.87
5.5.90.0030.01415.82
5.5.80.0030.01316.08
5.5.70.0030.01315.78
5.5.60.0030.01316.06
5.5.50.0090.00616.07
5.5.40.0090.00616.08
5.5.30.0100.00716.00
5.5.20.0090.00616.04
5.5.10.0080.00315.99
5.5.00.0070.00315.96
5.4.450.0150.03216.06
5.4.440.0210.03916.22
5.4.430.0120.02816.20
5.4.420.0160.02416.08
5.4.410.0150.02716.09
5.4.400.0210.02016.00
5.4.390.0150.02315.87
5.4.380.0130.02315.86
5.4.370.0130.02315.97
5.4.360.0150.02315.89
5.4.350.0130.02315.81
5.4.340.0130.02315.87
5.4.330.0030.01012.71
5.4.320.0160.01916.02
5.4.310.0170.01915.98
5.4.300.0170.02515.81
5.4.290.0170.01715.94
5.4.280.0120.02316.03
5.4.270.0100.02616.01
5.4.260.0140.02015.87
5.4.250.0130.02315.86
5.4.240.0180.02315.97
5.4.230.0150.02215.94
5.4.220.0120.02515.94
5.4.210.0160.02015.94
5.4.200.0130.02115.96
5.4.190.0170.02215.95
5.4.180.0160.02016.02
5.4.170.0130.02015.84
5.4.160.0190.01815.82
5.4.150.0150.02116.05
5.4.140.0140.01814.66
5.4.130.0150.02514.65
5.4.120.0120.02414.59
5.4.110.0160.02114.57
5.4.100.0150.01814.67
5.4.90.0130.02014.65
5.4.80.0130.02114.70
5.4.70.0130.02114.71
5.4.60.0120.02314.60
5.4.50.0180.02314.73
5.4.40.0180.02314.63
5.4.30.0150.02014.68
5.4.20.0130.02114.66
5.4.10.0150.02014.78
5.4.00.0120.02214.34
5.3.290.0200.04314.84
5.3.280.0200.03714.77
5.3.270.0170.04314.66
5.3.260.0200.04014.69
5.3.250.0270.03314.78
5.3.240.0230.03314.68
5.3.230.0230.03714.79
5.3.220.0200.04314.66
5.3.210.0230.04714.70
5.3.200.0200.03714.85
5.3.190.0230.03714.88
5.3.180.0200.03714.80
5.3.170.0230.03714.63
5.3.160.0330.04014.81
5.3.150.0230.03314.74
5.3.140.0300.02714.69
5.3.130.0230.04714.70
5.3.120.0270.03314.86
5.3.110.0270.05314.64
5.3.100.0270.05714.16
5.3.90.0270.03014.08
5.3.80.0330.05714.08
5.3.70.0330.06314.07
5.3.60.0230.03314.16
5.3.50.0270.07314.25
5.3.40.0370.06014.11
5.3.30.0330.03314.07
5.3.20.0300.05713.97
5.3.10.0270.07013.93
5.3.00.0300.08313.87
5.2.170.0230.06012.23
5.2.160.0230.05712.23
5.2.150.0200.03712.23
5.2.140.0230.03312.23
5.2.130.0200.03712.23
5.2.120.0200.06312.23
5.2.110.0270.05312.23
5.2.100.0170.03712.23
5.2.90.0200.06012.23
5.2.80.0270.04312.23
5.2.70.0270.05712.23
5.2.60.0230.06012.23
5.2.50.0330.05712.23
5.2.40.0200.06312.23
5.2.30.0200.06012.23
5.2.20.0200.04712.23
5.2.10.0230.06012.23
5.2.00.0270.04712.23
5.1.60.0270.04312.23
5.1.50.0200.04712.23
5.1.40.0300.04712.23
5.1.30.0230.05012.23
5.1.20.0270.02312.23
5.1.10.0270.04312.23
5.1.00.0200.03712.23
5.0.50.0200.01712.23
5.0.40.0130.04012.23
5.0.30.0100.03712.23
5.0.20.0200.01712.23
5.0.10.0070.02712.23
5.0.00.0130.03012.23
4.4.90.0170.02012.23
4.4.80.0100.03712.23
4.4.70.0130.02312.23
4.4.60.0100.02712.23
4.4.50.0170.01312.23
4.4.40.0070.02712.23
4.4.30.0170.03012.23
4.4.20.0130.02312.23
4.4.10.0070.02712.23
4.4.00.0100.05012.23
4.3.110.0070.02012.23
4.3.100.0070.02012.23
4.3.90.0130.01312.23
4.3.80.0030.02712.23
4.3.70.0100.02312.23
4.3.60.0070.03312.23
4.3.50.0070.01712.23
4.3.40.0070.03712.23
4.3.30.0030.02012.23
4.3.20.0030.01712.23
4.3.10.0030.03712.23
4.3.00.0070.02312.23

preferences:
39.19 ms | 401 KiB | 5 Q