3v4l.org

run code in 300+ PHP versions simultaneously
<?php function html($value) { return htmlentities($value); } class Foo { function html($value) { return htmlentities($value); } } $value = '123'; $object = new Foo(); // 1 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { htmlentities($value); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 2 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { html($value); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 3 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { $object->html($value); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 4 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func('html', $value); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 5 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func(array($object, 'html'), $value); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 6 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func_array('html', array($value)); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 7 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func_array(array($object, 'html'), array($value)); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\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.00.0070.19815.19
7.3.120.0130.12315.06
7.3.110.0070.13914.87
7.3.100.0030.11414.78
7.3.90.0030.11515.01
7.3.80.0030.11014.89
7.3.70.0070.10914.88
7.3.60.0000.13414.70
7.3.50.0070.13614.74
7.3.40.0070.11014.89
7.3.30.0030.13014.95
7.3.20.0070.11016.64
7.3.10.0030.13416.50
7.3.00.0130.11616.81
7.2.250.0130.18815.32
7.2.240.0100.13115.14
7.2.230.0070.13015.09
7.2.220.0030.12415.37
7.2.210.0100.11315.16
7.2.200.0070.12715.32
7.2.190.0000.15414.81
7.2.180.0030.12115.32
7.2.170.0070.13714.84
7.1.330.0070.18315.55
7.1.320.0030.16815.94
7.1.310.0030.17515.97
7.1.300.0000.18915.57
7.1.290.0070.19415.52
7.1.280.0070.16715.76
7.1.270.0070.16915.78
7.1.260.0100.15615.54
7.1.70.0200.12817.31
7.1.60.0000.16219.61
7.1.50.0030.14217.10
7.1.00.0030.20322.30
7.0.200.0030.12214.96
7.0.140.0130.19022.15
7.0.100.0600.17019.96
7.0.90.0600.18320.03
7.0.80.0530.16719.92
7.0.70.0070.17020.02
7.0.60.0100.20019.96
7.0.50.0130.18720.44
7.0.40.0170.19020.10
7.0.30.0070.18720.14
7.0.20.0170.17320.08
7.0.10.0100.17320.09
7.0.00.0070.19020.08
5.6.280.0070.42321.09
5.6.250.0070.51720.62
5.6.240.0200.39720.66
5.6.230.0130.40020.53
5.6.220.0070.40720.61
5.6.210.0070.43020.59
5.6.200.0070.43721.11
5.6.190.0000.44321.16
5.6.180.0070.40721.07
5.6.170.0070.46721.01
5.6.160.0500.38021.11
5.6.150.0170.40320.98
5.6.140.0070.39721.02
5.6.130.0100.40021.09
5.6.120.0070.39321.04
5.6.110.0070.41020.95
5.6.100.0130.42021.11
5.6.90.0070.40721.05
5.6.80.0030.40720.44
5.6.70.0000.48020.57
5.6.60.0070.43020.44
5.6.50.0130.41720.41
5.6.40.0000.44320.39
5.6.30.0100.38720.32
5.6.20.0070.40720.40
5.6.10.0130.41020.48
5.6.00.0200.40320.41
5.5.380.0100.36320.57
5.5.370.0100.36320.35
5.5.360.0070.36020.43
5.5.350.0100.36320.46
5.5.340.0030.37020.91
5.5.330.0070.35720.82
5.5.320.0130.35020.79
5.5.310.0030.35720.89
5.5.300.0070.37320.65
5.5.290.0030.39320.79
5.5.280.0130.35720.85
5.5.270.0100.40020.90
5.5.260.0100.35720.83
5.5.250.0070.35720.61
5.5.240.0130.36020.13
5.5.230.0030.36720.32
5.5.220.0070.37720.26
5.5.210.0000.37320.22
5.5.200.0130.37720.18
5.5.190.0130.35320.26
5.5.180.0070.38020.23
5.5.160.0030.35720.21
5.5.150.0030.35020.10
5.5.140.0100.36720.25
5.5.130.0100.37320.00
5.5.120.0070.36320.25
5.5.110.0070.34720.27
5.5.100.0000.31020.10
5.5.90.0030.32320.09
5.5.80.0030.29320.02
5.5.70.0030.34320.12
5.5.60.0100.30720.16
5.5.50.0030.36020.16
5.5.40.0000.28020.11
5.5.30.0030.30720.12
5.5.20.0100.32320.17
5.5.10.0030.29720.13
5.5.00.0170.34319.98
5.4.450.0130.38019.49
5.4.440.0130.35719.45
5.4.430.0030.35719.54
5.4.420.0030.35719.44
5.4.410.0000.40719.33
5.4.400.0070.35718.88
5.4.390.0130.37318.90
5.4.380.0100.36719.05
5.4.370.0100.33319.04
5.4.360.0100.37319.14
5.4.350.0100.39719.05
5.4.340.0030.36019.24
5.4.320.0130.35719.01
5.4.310.0100.36019.04
5.4.300.0070.35719.09
5.4.290.0130.34319.12
5.4.280.0070.37019.04
5.4.270.0070.35019.09
5.4.260.0100.34319.23
5.4.250.0030.31319.02
5.4.240.0030.30719.04
5.4.230.0030.24718.90
5.4.220.0030.25719.04
5.4.210.0070.24719.18
5.4.200.0030.30019.02
5.4.190.0000.29719.20
5.4.180.0030.29719.15
5.4.170.0070.38719.03
5.4.160.0000.36319.09
5.4.150.0030.37719.01
5.4.140.0100.34316.51
5.4.130.0100.34316.41
5.4.120.0100.34716.23
5.4.110.0100.33716.32
5.4.100.0000.38016.56
5.4.90.0130.33716.52
5.4.80.0070.37316.47
5.4.70.0100.34716.55
5.4.60.0100.37016.48
5.4.50.0070.37716.42
5.4.40.0070.35716.39
5.4.30.0100.37016.48
5.4.20.0000.35316.44
5.4.10.0070.33316.46
5.4.00.0030.35315.90
5.3.290.0070.42314.67
5.3.280.0030.32014.55
5.3.270.0100.43014.70
5.3.260.0070.43314.74
5.3.250.0100.41014.61
5.3.240.0070.46314.69
5.3.230.0030.45314.62
5.3.220.0030.43314.73
5.3.210.0130.42314.61
5.3.200.0070.44714.53
5.3.190.0070.43014.53
5.3.180.0070.43714.62
5.3.170.0000.45314.70
5.3.160.0100.44014.65
5.3.150.0130.42314.64
5.3.140.0030.45014.60
5.3.130.0030.45314.56
5.3.120.0000.44014.63
5.3.110.0000.47014.61
5.3.100.0100.46714.04
5.3.90.0070.46014.13
5.3.80.0000.44714.11
5.3.70.0030.44714.16
5.3.60.0030.46014.16
5.3.50.0030.45714.03
5.3.40.0030.44314.09
5.3.30.0070.44713.91
5.3.20.0030.46013.70
5.3.10.0100.38013.65
5.3.00.0070.43013.71
5.2.170.0000.47011.29
5.2.160.0000.50711.28
5.2.150.0000.54311.23
5.2.140.0030.51311.20
5.2.130.0070.50011.21
5.2.120.0070.50311.14
5.2.110.0000.49311.13
5.2.100.0770.43711.06
5.2.90.0070.50711.24
5.2.80.0100.52711.11
5.2.70.0130.50311.26
5.2.60.0030.52011.11
5.2.50.0070.50710.97
5.2.40.0000.51311.05
5.2.30.0030.49311.01
5.2.20.0030.51711.04
5.2.10.0070.51010.95
5.2.00.0000.51310.86
5.1.60.0030.54310.14
5.1.50.0070.54010.09
5.1.40.0100.57710.12
5.1.30.0070.51310.47
5.1.20.0070.48310.33
5.1.10.0070.53310.18
5.1.00.0030.54710.19
5.0.50.0070.7408.46
5.0.40.0000.6878.30
5.0.30.0070.6378.34
5.0.20.0100.6408.30
5.0.10.0100.6278.05
5.0.00.0030.6808.19
4.4.90.0000.6508.05
4.4.80.0030.6108.05
4.4.70.0070.6038.05
4.4.60.0030.6508.05
4.4.50.0000.6638.05
4.4.40.0100.6478.05
4.4.30.0030.6338.05
4.4.20.0000.6478.05
4.4.10.0000.6238.05
4.4.00.0000.6378.05
4.3.110.0000.6238.05
4.3.100.0000.6238.05
4.3.90.0070.6278.05
4.3.80.0030.6578.05
4.3.70.0030.6508.05
4.3.60.0070.5408.05
4.3.50.0030.6338.05
4.3.40.0000.6408.05
4.3.30.0000.4838.05
4.3.20.0030.5808.05
4.3.10.0030.5578.05
4.3.00.0000.5138.05

preferences:
67.63 ms | 401 KiB | 5 Q