3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $_field = "abcdefghijklmnopqrstuvwxyz"; public function __construct() {} } class B { public $_field = "abcdefghijklmnopqrstuvwxyz"; } $start = microtime(true); for ($i = 0; $i < 100000; $i++) $r = new A(); $time_taken = microtime(true) - $start; echo 'With construct: ' . $time_taken . 's' . PHP_EOL; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $r = new B(); $time_taken = microtime(true) - $start; echo 'Without construct: ' . $time_taken . 's' . PHP_EOL;

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.0130.02514.98
7.3.120.0130.03014.44
7.3.110.0070.03414.51
7.3.100.0100.02014.58
7.3.90.0030.02314.53
7.3.80.0000.02714.88
7.3.70.0070.02414.81
7.3.60.0070.02414.96
7.3.50.0070.02114.91
7.3.40.0100.01714.39
7.3.30.0060.01814.57
7.3.20.0000.02216.46
7.3.10.0070.02116.66
7.3.00.0150.01516.47
7.2.250.0130.02915.05
7.2.240.0000.04215.21
7.2.230.0090.02215.18
7.2.220.0100.02214.81
7.2.210.0070.02415.18
7.2.200.0100.02115.05
7.2.190.0090.02115.04
7.2.180.0060.02815.11
7.2.170.0000.03114.88
7.2.00.0030.02419.46
7.1.330.0070.03615.87
7.1.320.0100.03915.89
7.1.310.0070.04015.92
7.1.300.0130.03515.58
7.1.290.0070.03915.89
7.1.280.0000.04115.85
7.1.270.0070.04315.71
7.1.260.0030.03815.83
7.1.70.0000.02517.22
7.1.60.0070.04219.40
7.1.50.0030.05116.99
7.1.00.0030.08322.48
7.0.200.0030.01916.94
7.0.140.0130.09022.07
7.0.110.0470.08019.96
7.0.100.0570.09720.14
7.0.90.0600.08319.98
7.0.80.0200.10319.93
7.0.70.0530.08019.91
7.0.60.0530.08720.05
7.0.50.0630.11320.39
7.0.40.0070.09320.03
7.0.30.0200.06019.97
7.0.20.0100.10020.06
7.0.10.0030.10320.15
7.0.00.0030.11720.23
5.6.280.0000.12320.95
5.6.250.0030.12320.63
5.6.240.0070.09320.72
5.6.230.0170.11020.62
5.6.220.0030.12020.67
5.6.210.0070.11320.68
5.6.200.0070.11321.15
5.6.190.0100.11021.29
5.6.180.0100.10720.95
5.6.170.0170.11721.23
5.6.160.0100.12021.03
5.6.150.0000.12021.22
5.6.140.0130.11321.13
5.6.130.0100.11721.29
5.6.120.0130.10721.09
5.6.110.0070.10720.89
5.6.100.0070.11021.01
5.6.90.0100.11721.25
5.6.80.0130.10320.34
5.6.70.0030.12020.31
5.6.60.0070.12020.52
5.6.50.0100.07720.61
5.6.40.0030.12020.50
5.6.30.0030.10320.41
5.6.20.0130.11320.46
5.6.10.0100.10720.64
5.6.00.0200.09320.40
5.5.380.0070.09320.42
5.5.370.0200.11020.36
5.5.360.0170.11320.28
5.5.350.0070.07720.48
5.5.340.0130.11020.87
5.5.330.0100.12320.96
5.5.320.0030.08721.00
5.5.310.0170.10320.69
5.5.300.0170.10020.80
5.5.290.0170.11720.75
5.5.280.0070.12020.75
5.5.270.0170.10320.97
5.5.260.0100.12320.89
5.5.250.0030.12720.80
5.5.240.0070.11320.42
5.5.230.0030.11320.27
5.5.220.0030.11720.32
5.5.210.0100.11720.19
5.5.200.0030.10720.35
5.5.190.0070.11020.16
5.5.180.0070.12320.31
5.5.160.0070.10020.22
5.5.150.0130.10720.12
5.5.140.0130.10720.24
5.5.130.0070.11720.25
5.5.120.0070.11020.25
5.5.110.0130.12020.13
5.5.100.0130.12020.20
5.5.90.0100.06320.25
5.5.80.0000.12320.16
5.5.70.0200.10720.04
5.5.60.0070.11020.04
5.5.50.0130.09720.13
5.5.40.0100.11720.06
5.5.30.0100.11320.21
5.5.20.0070.11020.13
5.5.10.0030.11720.02
5.5.00.0170.11320.21
5.4.450.0100.11019.65
5.4.440.0100.11319.35
5.4.430.0170.11019.64
5.4.420.0070.10719.27
5.4.410.0000.11719.21
5.4.400.0100.10719.01
5.4.390.0130.12019.24
5.4.380.0130.10019.09
5.4.370.0000.12319.00
5.4.360.0070.10319.21
5.4.350.0100.11318.95
5.4.340.0170.10019.09
5.4.320.0100.11719.01
5.4.310.0100.11719.09
5.4.300.0130.11319.31
5.4.290.0130.11319.14
5.4.280.0100.11719.22
5.4.270.0070.10019.37
5.4.260.0170.10318.98
5.4.250.0070.11318.98
5.4.240.0070.08019.18
5.4.230.0100.11019.00
5.4.220.0130.11018.93
5.4.210.0170.10319.31
5.4.200.0130.09319.16
5.4.190.0070.11719.32
5.4.180.0100.12019.17
5.4.170.0070.11318.99
5.4.160.0100.09318.96
5.4.150.0130.11019.09
5.4.140.0100.10316.57
5.4.130.0070.10316.62
5.4.120.0100.11316.41
5.4.110.0030.08016.64
5.4.100.0130.08716.42
5.4.90.0100.11716.56
5.4.80.0100.10016.46
5.4.70.0070.10716.52
5.4.60.0070.08316.42
5.4.50.0100.09716.44
5.4.40.0070.10716.34
5.4.30.0030.11316.53
5.4.20.0100.11316.28
5.4.10.0170.08716.54
5.4.00.0070.11015.74
5.3.290.0130.12714.79
5.3.280.0000.14014.73
5.3.270.0130.11014.62
5.3.260.0200.11314.70
5.3.250.0100.13714.66
5.3.240.0070.13014.75
5.3.230.0070.13014.73
5.3.220.0070.12714.59
5.3.210.0100.11714.65
5.3.200.0030.15014.70
5.3.190.0100.14014.53
5.3.180.0170.12714.79
5.3.170.0070.13014.42
5.3.160.0030.12714.56
5.3.150.0030.12714.52
5.3.140.0070.12714.55
5.3.130.0030.13714.56
5.3.120.0070.12314.57
5.3.110.0030.12714.60
5.3.100.0130.11714.00
5.3.90.0070.12014.03
5.3.80.0030.14313.97
5.3.70.0000.15014.02
5.3.60.0070.13014.09
5.3.50.0070.08713.92
5.3.40.0100.13013.95
5.3.30.0100.12014.04
5.3.20.0070.14013.83
5.3.10.0030.13713.51
5.3.00.0100.10013.63
5.2.170.0070.13711.12
5.2.160.0100.13711.11
5.2.150.0030.14711.37
5.2.140.0100.12311.14
5.2.130.0130.12011.25
5.2.120.0070.13311.09
5.2.110.0130.13311.11
5.2.100.0030.12711.12
5.2.90.0070.10011.06
5.2.80.0000.12311.09
5.2.70.0030.13011.11
5.2.60.0000.11711.06
5.2.50.0030.12710.99
5.2.40.0030.13010.99
5.2.30.0100.13010.98
5.2.20.0070.12010.96
5.2.10.0070.13310.83
5.2.00.0030.12310.86
5.1.60.0170.11310.25
5.1.50.0100.11010.25
5.1.40.0130.1139.98
5.1.30.0100.09310.28
5.1.20.0030.12710.34
5.1.10.0070.10010.04
5.1.00.0000.07710.16
5.0.50.0000.1408.73
5.0.40.0030.0838.40
5.0.30.0070.1538.06
5.0.20.0030.0808.21
5.0.10.0000.1378.36
5.0.00.0000.0938.25
4.4.90.0000.0377.93
4.4.80.0070.0307.93
4.4.70.0000.0337.93
4.4.60.0030.0337.93
4.4.50.0070.0177.93
4.4.40.0000.0577.93
4.4.30.0100.0277.93
4.4.20.0030.0207.93
4.4.10.0000.0377.93
4.4.00.0100.0477.93
4.3.110.0000.0207.93
4.3.100.0070.0137.93
4.3.90.0030.0337.93
4.3.80.0030.0237.93
4.3.70.0000.0177.93
4.3.60.0000.0177.93
4.3.50.0000.0177.93
4.3.40.0030.0207.93
4.3.30.0000.0277.93
4.3.20.0070.0237.93
4.3.10.0000.0137.93
4.3.00.0000.0137.93

preferences:
41.14 ms | 401 KiB | 5 Q