3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arraydiff(&$array1, &$array2) { $a1 = array_flip($array1); $a2 = array_flip($array2); $differences = array(); //what is in array 1 that is not in array2 $c = count($a1); foreach ($a1 as $k => $v) { if (!isset($a2[$k])) { $differences[] = $k; } } return $differences; } $i=0; $j=500000; while($i < 60000) { $i++; $j++; $data1[] = md5($i); $data2[] = md5($j); } $time = microtime(true); echo "Starting arraydiff\n"; $data_diff1 = arraydiff($data1, $data2); $time = microtime(true) - $time; echo 'arraydiff() took ' . number_format($time, 3) . ' seconds and returned ' . count($data_diff1) . " entries\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.3.10.0350.05335.13
7.3.00.0310.05634.91
7.2.130.0230.06334.49
7.2.120.0130.06634.83
7.2.110.0230.07934.76
7.2.100.0330.06334.50
7.2.90.0330.05634.72
7.2.80.0460.04634.60
7.2.70.0330.06334.75
7.2.60.0450.06634.46
7.2.50.0600.06034.92
7.2.40.0440.07034.76
7.2.30.0570.05434.67
7.2.20.0510.06634.71
7.2.10.0360.06834.64
7.2.00.0210.05935.91
7.1.250.0230.07333.74
7.1.70.0030.08835.18
7.1.60.0100.10635.12
7.1.50.0070.05734.97
7.1.00.0070.14340.48
7.0.200.0410.05134.61
7.0.140.0130.13340.23
7.0.60.0470.14337.42
7.0.50.0070.14034.84
7.0.40.0070.14329.38
7.0.30.0430.13329.24
7.0.20.0500.09029.43
7.0.10.0130.10029.48
7.0.00.0170.13329.31
5.6.280.0170.22377.07
5.6.210.0100.18076.67
5.6.200.0200.22774.35
5.6.190.0330.18076.66
5.6.180.3700.16076.55
5.6.170.0570.19776.52
5.6.160.0170.22776.77
5.6.150.0230.18374.57
5.6.140.0170.17074.43
5.6.130.0170.22074.38
5.6.120.0200.19777.19
5.6.110.0400.21377.23
5.6.100.0370.20077.20
5.6.90.0370.21377.18
5.6.80.0370.15776.57
5.5.350.0270.14376.62
5.5.340.0230.18074.17
5.5.330.0270.15076.46
5.5.320.0300.15776.41
5.5.310.0430.20076.30
5.5.300.0270.14774.14
5.5.290.0400.19774.17
5.5.280.0300.19777.05
5.5.270.0370.20076.88
5.5.260.0100.16376.97
5.5.250.0130.23076.68
5.5.240.0230.22776.36
5.4.450.0670.20075.55
5.4.440.0870.15775.43
5.4.430.0600.24075.60
5.4.420.0300.24075.62
5.4.410.0770.23075.48
5.4.400.0730.22075.04
5.4.390.0370.23075.35
5.4.380.1670.38774.89
5.4.370.0830.31774.94
5.4.360.0500.31074.79
5.4.350.0670.25374.77
5.4.340.0730.25774.65
5.4.320.0290.15668.70
5.4.310.0330.15268.70
5.4.300.0210.16568.70
5.4.290.0250.16768.70
5.4.280.0220.17068.60
5.4.270.0280.16468.60
5.4.260.0240.17068.60
5.4.250.0210.17568.59
5.4.240.0270.16968.60
5.4.230.0280.17768.59
5.4.220.0270.17668.59
5.4.210.0210.20668.59
5.4.200.0170.17968.59
5.4.190.0210.17468.59
5.4.180.0300.16668.59
5.4.170.0300.18268.59
5.4.160.0320.17868.59
5.4.150.0310.18868.59
5.4.140.0300.18768.27
5.4.130.0360.17568.26
5.4.120.0260.17568.22
5.4.110.0320.19268.21
5.4.100.0250.19668.21
5.4.90.0290.17068.21
5.4.80.0300.18268.21
5.4.70.0200.17468.20
5.4.60.0320.16768.21
5.4.50.0220.18368.21
5.4.40.0300.16868.20
5.4.30.0290.16668.20
5.4.20.0370.17968.20
5.4.10.0250.18568.19
5.4.00.0330.18767.68
5.3.290.0200.19767.35
5.3.280.0300.17567.29
5.3.270.0290.19267.93
5.3.260.0270.19367.30
5.3.250.0300.20367.30
5.3.240.0280.18767.30
5.3.230.0300.19167.29
5.3.220.0270.18467.26
5.3.210.0220.18167.26
5.3.200.0160.20067.25
5.3.190.0260.18067.25
5.3.180.0210.18767.25
5.3.170.0280.17567.25
5.3.160.0280.18967.25
5.3.150.0250.19567.25
5.3.140.0250.18967.24
5.3.130.0240.19067.24
5.3.120.0310.17667.24
5.3.110.0210.19167.24
5.3.100.0240.19566.72
5.3.90.0210.18866.71
5.3.80.0270.18366.70
5.3.70.0190.18366.70
5.3.60.0200.18466.68
5.3.50.0200.19366.63
5.3.40.0370.18466.63
5.3.30.0270.17966.59
5.3.20.0250.18466.37
5.3.10.0260.18166.33
5.3.00.0170.19166.32
5.2.170.0270.20561.42
5.2.160.0240.20061.42
5.2.150.0240.17861.42
5.2.140.0280.17661.41
5.2.130.0280.17861.38
5.2.120.0270.18861.38
5.2.110.0230.17661.38
5.2.100.0210.17261.38
5.2.90.0240.17961.38
5.2.80.0310.17861.37
5.2.70.0170.18861.37
5.2.60.0250.17861.32
5.2.50.0160.22761.36
5.2.40.0220.22461.34
5.2.30.0260.20961.32
5.2.20.0260.42361.32
5.2.10.0280.33061.14
5.2.00.0230.35361.00
5.1.60.0300.38778.29
5.1.50.0330.38578.28
5.1.40.0410.36178.27
5.1.30.0370.36578.61
5.1.20.0200.36778.63
5.1.10.0280.38478.36
5.1.00.0250.42078.36
5.0.50.0180.44076.84
5.0.40.0330.41376.70
5.0.30.0230.44376.52
5.0.20.0320.46376.48
5.0.10.0250.42176.46
5.0.00.0410.43976.45
4.4.90.0280.45874.89
4.4.80.0310.43974.86
4.4.70.0310.42774.86
4.4.60.0260.42374.87
4.4.50.0260.46174.89
4.4.40.0300.43574.87
4.4.30.0340.42174.87
4.4.20.0280.42174.93
4.4.10.0320.42674.93
4.4.00.0250.43574.91
4.3.110.0250.41874.81
4.3.100.0260.42674.80
4.3.90.0260.41974.79
4.3.80.0290.45674.80
4.3.70.0260.41274.79
4.3.60.0300.41974.79
4.3.50.0320.43774.79
4.3.40.0230.44574.75
4.3.30.0410.42173.56
4.3.20.0270.40773.54
4.3.10.0440.44973.49
4.3.00.0330.42374.64

preferences:
35.51 ms | 400 KiB | 5 Q