3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { return ""; } } $ts = microtime(true); for ($i=1; $i<=10000; $i++) { $c = new Foo(); echo $c->bar(); unset ($c); } $tt = microtime(true); $t1 = $tt-$ts; unset($ts, $tt); echo "Variable Instantiation takes {$t1} seconds\n"; $ts = microtime(true); for ($i=1; $i<=10000; $i++) { echo (new Foo())->bar(); } $tt = microtime(true); $t2 = $tt-$ts; unset($ts, $tt); echo "Magic Instantiation takes {$t2} seconds\n"; echo "\n"; if ($t1 < $t2) { echo "Variable Instantion is faster by a factor of ".round(($t2/$t1), 2)."\n"; } else { echo "Magic Instantion is faster by a factor of ".round(($t1/$t2), 2)."\n"; }

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.0100.01014.98
7.4.00.0070.01515.21
7.3.130.0000.02015.13
7.3.120.0040.01414.83
7.3.110.0040.01914.56
7.3.100.0070.01014.71
7.3.90.0070.00814.93
7.3.80.0000.01614.80
7.3.70.0100.00615.03
7.3.60.0060.00914.56
7.3.50.0110.00715.06
7.3.40.0080.00814.71
7.3.30.0070.01014.84
7.3.20.0000.01916.80
7.3.10.0070.00716.66
7.3.00.0090.00616.57
7.2.260.0180.00415.27
7.2.250.0070.01314.68
7.2.240.0110.00715.06
7.2.230.0060.01114.96
7.2.220.0030.01315.28
7.2.210.0100.00714.99
7.2.200.0070.01015.20
7.2.190.0000.01515.25
7.2.180.0100.01015.00
7.2.170.0100.00714.89
7.2.160.0070.01015.20
7.2.150.0100.01016.94
7.2.140.0030.01316.93
7.2.130.0030.01316.86
7.2.120.0100.00716.63
7.2.110.0060.00616.76
7.2.100.0060.00916.99
7.2.90.0030.01416.80
7.2.80.0060.00916.86
7.2.70.0100.01016.95
7.2.60.0090.00916.67
7.2.50.0130.00316.90
7.2.40.0070.01016.82
7.2.30.0070.01016.62
7.2.20.0060.01317.06
7.2.10.0100.00617.05
7.2.00.0050.01118.04
7.1.330.0060.01315.63
7.1.320.0070.01015.87
7.1.310.0090.01215.80
7.1.300.0090.00915.82
7.1.290.0000.01315.44
7.1.280.0030.01615.43
7.1.270.0040.01415.58
7.1.260.0000.01615.90
7.1.250.0040.01515.76
7.1.240.0070.01315.65
7.1.230.0100.01015.85
7.1.220.0000.02116.02
7.1.210.0030.01315.98
7.1.200.0120.00915.91
7.1.190.0030.01315.96
7.1.180.0060.01215.48
7.1.170.0090.00915.90
7.1.160.0100.01015.92
7.1.150.0000.02015.58
7.1.140.0070.01415.97
7.1.130.0040.01815.69
7.1.120.0030.01615.80
7.1.110.0070.01715.88
7.1.100.0070.01415.99
7.1.90.0110.00615.93
7.1.80.0000.01715.94
7.1.70.0030.01116.53
7.1.60.0070.01517.52
7.1.50.0020.01216.49
7.1.40.0090.01215.74
7.1.30.0000.01915.83
7.1.20.0030.01615.62
7.1.10.0070.01015.92
7.1.00.0070.03219.03
7.0.330.0100.01015.36
7.0.320.0040.01815.13
7.0.310.0100.01015.42
7.0.300.0070.01015.21
7.0.290.0030.01315.63
7.0.280.0100.01015.50
7.0.270.0030.01615.27
7.0.260.0000.02415.59
7.0.250.0000.01815.60
7.0.240.0060.01015.48
7.0.230.0100.00715.48
7.0.220.0110.00715.54
7.0.210.0030.01715.43
7.0.200.0030.01116.19
7.0.190.0040.01415.55
7.0.180.0090.00915.44
7.0.170.0030.01515.47
7.0.160.0040.01415.41
7.0.150.0100.00615.21
7.0.140.0070.04318.67
7.0.130.0000.02115.29
7.0.120.0020.04618.80
7.0.110.0070.01415.60
7.0.100.0070.01015.57
7.0.90.0040.00815.33
7.0.80.0030.01615.42
7.0.70.0100.01315.39
7.0.60.0020.04117.73
7.0.50.0050.05016.63
7.0.40.0050.05216.90
7.0.30.0150.04916.72
7.0.20.0200.04416.92
7.0.10.0200.02516.77
7.0.00.0090.02916.81
5.6.400.0080.01514.28
5.6.390.0060.01614.54
5.6.380.0060.01614.43
5.6.370.0060.01614.33
5.6.360.0090.01514.61
5.6.350.0070.01714.30
5.6.340.0030.02014.33
5.6.330.0040.02214.30
5.6.320.0000.02314.00
5.6.310.0040.01614.66
5.6.300.0120.01214.32
5.6.290.0000.01814.62
5.6.280.0100.04017.63
5.6.270.0040.01814.34
5.6.260.0040.01814.25
5.6.250.0040.02114.29
5.6.240.0100.01414.39
5.6.230.0030.02014.13
5.6.220.0060.02314.65
5.6.210.0040.03317.41
5.6.200.0070.03816.23
5.6.190.0080.05517.51
5.6.180.0180.05017.38
5.6.170.0130.02817.47
5.6.160.0080.04917.36
5.6.150.0070.05016.09
5.6.140.0080.04816.43
5.6.130.0150.03116.23
5.6.120.0100.03517.64
5.6.110.0050.02717.67
5.6.100.0100.03217.72
5.6.90.0090.04917.56
5.6.80.0050.03017.21
5.6.70.1400.03517.38
5.6.60.0070.01714.32
5.6.50.0040.02314.39
5.6.40.0070.01414.34
5.6.30.0070.01714.44
5.6.20.0090.01514.05
5.6.10.0060.01914.34
5.6.00.0000.01614.15
5.5.380.0070.01614.32
5.5.370.0030.02514.44
5.5.360.0100.01314.15
5.5.350.0050.05017.45
5.5.340.0070.05016.02
5.5.330.0070.05317.09
5.5.320.0150.03117.27
5.5.310.0230.02617.22
5.5.300.0050.03616.21
5.5.290.0070.02816.15
5.5.280.0120.04817.52
5.5.270.0050.03217.56
5.5.260.0060.05117.59
5.5.250.0100.04417.50
5.5.240.0100.05117.23
5.5.230.0030.02514.09
5.5.220.0000.02614.18
5.5.210.0100.01414.49
5.5.200.0100.01714.15
5.5.190.0070.01714.34
5.5.180.0030.01913.91
5.5.170.0000.02214.38
5.5.160.0060.01514.11
5.5.150.0030.02014.09
5.5.140.0060.01614.11
5.5.130.0000.02114.10
5.5.120.0030.01614.38
5.5.110.0030.02014.42
5.5.100.0070.01814.13
5.5.90.0070.01614.13
5.5.80.0040.02114.17
5.5.70.0030.01614.20
5.5.60.0070.01714.32
5.5.50.0100.01314.54
5.5.40.0070.01414.39
5.5.30.0030.02014.33
5.5.20.0100.01314.26
5.5.10.0070.01814.34
5.5.00.0030.01613.96
5.4.450.1600.03415.16
5.4.440.0130.02715.19
5.4.430.1720.02915.53
5.4.420.1550.03215.25
5.4.410.1590.02415.12
5.4.400.1210.02614.97
5.4.390.1930.02215.13
5.4.380.1530.02914.94
5.4.370.1630.03214.86
5.4.360.2000.02714.90
5.4.350.1700.02915.14
5.4.340.1640.02415.30
5.4.330.0060.01311.04
5.4.320.1800.02915.15
5.4.310.1910.02815.22
5.4.300.1680.02815.05
5.4.290.1670.03015.01
5.4.280.2030.02515.00
5.4.270.2020.03115.07
5.4.260.2030.02615.02
5.4.250.1900.02815.03
5.4.240.1980.02715.10
5.4.230.1870.02915.33
5.4.220.1720.03315.14
5.4.210.1710.02815.22
5.4.200.1800.03115.11
5.4.190.1730.02614.91
5.4.180.1880.02715.00
5.4.170.1960.02914.97
5.4.160.2030.03315.17
5.4.150.1700.02914.93
5.4.140.1790.02913.74
5.4.130.1750.02413.74
5.4.120.1830.02813.68
5.4.110.1980.02813.73
5.4.100.1980.02813.70
5.4.90.1800.03113.71
5.4.80.1720.03113.51
5.4.70.1620.03113.69
5.4.60.1710.02913.84
5.4.50.1530.03313.71
5.4.40.1650.02613.70
5.4.30.1750.03313.62
5.4.20.1770.02913.84
5.4.10.2000.02813.74
5.4.00.2020.02613.39
5.3.290.1960.01812.40
5.3.280.1670.02012.42
5.3.270.2040.02012.47
5.3.260.1550.02312.31
5.3.250.1770.02212.52
5.3.240.1580.02512.51
5.3.230.1930.02512.48
5.3.220.1770.02412.38
5.3.210.1680.02312.29
5.3.200.1950.02112.41
5.3.190.1920.01812.53
5.3.180.1710.02312.34
5.3.170.1880.02412.37
5.3.160.1750.02612.43
5.3.150.1750.02212.44
5.3.140.1870.01812.51
5.3.130.1730.02212.48
5.3.120.1880.02012.39
5.3.110.1980.02012.30
5.3.100.1710.02112.12
5.3.90.1750.02412.23
5.3.80.1590.01512.11
5.3.70.1960.01312.07
5.3.60.1660.02112.11
5.3.50.2270.02512.22
5.3.40.1560.01512.18
5.3.30.1560.02012.05
5.3.20.1610.02111.95
5.3.10.0060.02011.85
5.3.00.0070.03011.80
5.2.170.2770.03311.07
5.2.160.2700.03011.27
5.2.150.2830.02711.37
5.2.140.2470.03311.36
5.2.130.3130.02711.06
5.2.120.1070.04011.08
5.2.110.0100.06311.10
5.2.100.2400.03011.33
5.2.90.3270.02711.18
5.2.80.2970.03011.25
5.2.70.3400.02311.14
5.2.60.3030.02010.97
5.2.50.3070.03010.95
5.2.40.2570.02710.92
5.2.30.2300.03711.02
5.2.20.2330.03010.90
5.2.10.2670.02710.90
5.2.00.1900.03310.94
5.1.60.2000.02310.90
5.1.50.1800.02310.90
5.1.40.2000.02310.90
5.1.30.2030.03010.90
5.1.20.2070.02710.90
5.1.10.2030.02310.90
5.1.00.1970.02710.90
5.0.50.0970.02310.90
5.0.40.1200.02310.90
5.0.30.1000.02710.90
5.0.20.1030.01710.90
5.0.10.1200.02010.90
5.0.00.0970.03310.90
4.4.90.1370.01710.90
4.4.80.1530.01710.90
4.4.70.1130.01710.90
4.4.60.1330.02310.90
4.4.50.1270.01010.90
4.4.40.1230.02310.90
4.4.30.1000.01710.90
4.4.20.0800.01310.90
4.4.10.1000.01310.90
4.4.00.1000.02310.90
4.3.110.0970.02010.90
4.3.100.1200.01310.90
4.3.90.0770.01310.90
4.3.80.0000.02710.90
4.3.70.0030.01310.90
4.3.60.0000.01710.90
4.3.50.0030.01310.90
4.3.40.0000.02310.90
4.3.30.0030.01310.90
4.3.20.0000.01710.90
4.3.10.0000.01710.90
4.3.00.0030.01310.90

preferences:
41.48 ms | 401 KiB | 5 Q