3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Init: ".memory_get_usage() . PHP_EOL . PHP_EOL; $test = $test2 = array(); $i = 0; while ($i++ < 100000) { $test[] = $i; $test2[] = $i; } // test loop 1 echo "Test 1: ".memory_get_usage() . PHP_EOL; foreach ($test as $k => $v) { unset($test[$k]); } echo memory_get_usage() . PHP_EOL . PHP_EOL; // test loop 2 echo "Test 2: ".memory_get_usage() . PHP_EOL; echo memory_get_usage() . PHP_EOL; foreach ($test as $k => &$v) { unset($test[$k]); } echo memory_get_usage() . PHP_EOL . 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.2.00.0390.01032.50
7.1.70.0460.01329.96
7.1.60.0070.02130.44
7.1.50.0350.03929.98
7.1.00.0070.09035.34
7.0.200.0190.00929.89
7.0.140.0030.09035.04
7.0.80.0800.05031.92
7.0.70.2670.07332.00
7.0.60.3400.07731.90
7.0.50.3430.08032.31
7.0.40.2170.08729.14
7.0.30.2400.08329.11
7.0.20.1970.07029.34
7.0.10.2100.07329.29
7.0.00.2600.08029.20
5.6.280.0200.12354.11
5.6.230.0130.08053.60
5.6.220.0170.10053.59
5.6.210.0070.09753.76
5.6.200.0300.13054.18
5.6.190.0330.11754.02
5.6.180.0170.07753.92
5.6.170.0230.07354.07
5.6.160.0170.08353.94
5.6.150.0170.09053.97
5.6.140.0170.08754.02
5.6.130.0230.08753.96
5.6.120.0130.08753.95
5.6.110.0230.09354.04
5.6.100.0270.11754.02
5.6.90.0070.10054.02
5.6.80.0130.08753.39
5.6.70.0170.07753.37
5.6.60.0400.09353.47
5.6.50.0100.08753.34
5.6.40.0230.11353.38
5.6.30.0200.07353.44
5.6.20.0130.12053.53
5.6.10.0230.11753.40
5.6.00.0300.13053.45
5.5.370.0170.09353.50
5.5.360.0200.09053.33
5.5.350.0200.08053.42
5.5.340.0130.13053.87
5.5.330.0200.12753.89
5.5.320.0200.12053.74
5.5.310.0130.13753.93
5.5.300.0400.11753.80
5.5.290.0130.13053.84
5.5.280.0200.14053.87
5.5.270.0170.13053.87
5.5.260.0200.12753.86
5.5.250.0270.11353.59
5.5.240.0200.13353.30
5.5.230.0130.13053.29
5.5.220.0270.11053.21
5.5.210.0270.10353.16
5.5.200.0330.10753.19
5.5.190.0070.13353.22
5.5.180.0170.13753.25
5.5.160.0270.11053.18
5.5.150.0100.13753.12
5.5.140.0230.10353.11
5.5.130.0270.12353.23
5.5.120.0270.13053.08
5.5.110.0130.13353.17
5.5.100.0070.11753.14
5.5.90.0300.11053.01
5.5.80.0200.07353.09
5.5.70.0170.07353.09
5.5.60.0200.06753.03
5.5.50.0200.08753.07
5.5.40.0170.07353.15
5.5.30.0170.07053.08
5.5.20.0170.06053.08
5.5.10.0030.08353.01
5.5.00.0100.07753.03
5.4.450.0230.12352.05
5.4.440.0170.12052.04
5.4.430.0370.11752.20
5.4.420.0200.15052.17
5.4.410.0030.10352.28
5.4.400.0230.12351.93
5.4.390.0130.13751.99
5.4.380.0230.07351.76
5.4.370.0100.12751.84
5.4.360.0170.12051.70
5.4.350.0400.11051.89
5.4.340.0370.11751.89
5.4.320.0330.10351.72
5.4.310.0170.12752.09
5.4.300.0300.11752.02
5.4.290.0270.10752.08
5.4.280.0230.13051.93
5.4.270.0270.12051.98
5.4.260.0300.11751.97
5.4.250.0130.07352.02
5.4.240.0230.09351.85
5.4.230.0200.07051.93
5.4.220.0130.07751.93
5.4.210.0100.07752.04
5.4.200.0100.07052.05
5.4.190.0000.09751.88
5.4.180.0130.07351.89
5.4.170.0100.08351.91
5.4.160.0170.07051.96
5.4.150.0100.07351.86
5.4.140.0070.07749.27
5.4.130.0130.07049.30
5.4.120.0170.13049.09
5.4.110.0270.08349.28
5.4.100.0030.07049.19
5.4.90.0100.07349.21
5.4.80.0130.06049.32
5.4.70.0130.05749.29
5.4.60.0100.07349.28
5.4.50.0130.07049.31
5.4.40.0130.07049.39
5.4.30.0070.07749.39
5.4.20.0230.05749.20
5.4.10.0070.07749.21
5.4.00.0070.07348.75
5.3.290.0200.09346.89
5.3.280.0170.08346.96
5.3.270.0100.07746.92
5.3.260.0130.07346.82
5.3.250.0100.13346.98
5.3.240.0170.07746.88
5.3.230.0170.07346.88
5.3.220.0130.08746.84
5.3.210.0100.06746.89
5.3.200.0100.07746.77
5.3.190.0170.07046.89
5.3.180.0030.08346.77
5.3.170.0130.07346.84
5.3.160.0170.06746.76
5.3.150.0000.07746.89
5.3.140.0100.07746.93
5.3.130.0100.07746.89
5.3.120.0070.07046.76
5.3.110.0070.08047.20
5.3.100.0030.07346.35
5.3.90.0100.07746.23
5.3.80.0130.07046.22
5.3.70.0100.07746.25
5.3.60.0130.07046.22
5.3.50.0100.08046.25
5.3.40.0170.07346.59
5.3.30.0200.12046.19
5.3.20.0230.10045.99
5.3.10.0100.14045.95
5.3.00.0230.11345.93
5.2.170.0130.07042.63
5.2.160.0170.06342.74
5.2.150.0170.08742.67
5.2.140.0170.10042.62
5.2.130.0200.13042.54
5.2.120.0370.11042.67
5.2.110.0170.11042.47
5.2.100.0270.11742.68
5.2.90.0200.13043.10
5.2.80.0300.08342.64
5.2.70.0070.08042.64
5.2.60.0030.08742.61
5.2.50.0170.10742.61
5.2.40.0230.13742.57
5.2.30.0070.13742.54
5.2.20.0170.09042.70
5.2.10.0400.11042.52
5.2.00.0030.04012.19
5.1.60.0070.05012.19
5.1.50.0000.04012.19
5.1.40.0070.05712.19
5.1.30.0070.05312.19
5.1.20.0030.05712.19
5.1.10.0070.05312.19
5.1.00.0000.03712.19
5.0.50.0030.05012.19
5.0.40.0000.04012.19
5.0.30.0100.05712.19
5.0.20.0130.03312.19
5.0.10.0030.03712.19
5.0.00.0000.06312.19
4.4.90.0030.01312.19
4.4.80.0000.03712.19
4.4.70.0030.03712.19
4.4.60.0000.03712.19
4.4.50.0030.04012.19
4.4.40.0030.02312.19
4.4.30.0000.03712.19
4.4.20.0070.02312.19
4.4.10.0030.03312.19
4.4.00.0000.05312.19
4.3.110.0030.03012.19
4.3.100.0070.03712.19
4.3.90.0030.03012.19
4.3.80.0100.03712.19
4.3.70.0030.02712.19
4.3.60.0070.03012.19
4.3.50.0030.03712.19
4.3.40.0000.04712.19
4.3.30.0030.02712.19
4.3.20.0000.02712.19
4.3.10.0000.03712.19
4.3.00.0070.03312.19

preferences:
32.37 ms | 401 KiB | 5 Q