3v4l.org

run code in 300+ PHP versions simultaneously
<?php function common_parts($data) { for ($b = 1; ; $b *= 10) { $base = intdiv($data[0], $b); $matches = array_filter($data, function ($v) use ($b, $base) { return intdiv($v, $b) != $base; }); if (count($matches) == 0) break; } $base *= $b; for ($i = 1; $i < count($data); $i++) { $data[$i] = $data[$i] - $base; } return $data; } print_r(common_parts(array(670006151,670006152,670006251))); print_r(common_parts(array(670006151,670006154,670006158))); print_r(common_parts(array(670006151,670006154,670006161)));

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)
8.4.20.0100.01018.17
8.4.10.0120.00619.58
8.3.150.0080.00817.02
8.3.140.0080.00818.97
8.3.130.0070.01418.50
8.3.120.0060.00318.92
8.3.110.0050.00320.94
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0060.00319.36
8.3.70.0080.00818.80
8.3.60.0100.00716.50
8.3.50.0070.01324.57
8.3.40.0080.00818.69
8.3.30.0110.01118.79
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0050.00326.16
8.2.270.0070.00716.66
8.2.260.0140.00418.87
8.2.250.0080.00018.52
8.2.240.0060.00317.42
8.2.230.0040.00422.58
8.2.220.0030.00637.54
8.2.210.0040.01126.77
8.2.200.0120.00018.88
8.2.190.0100.00618.15
8.2.180.0110.01125.92
8.2.170.0120.00919.07
8.2.160.0140.00322.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0030.00620.61
8.2.110.0030.00621.00
8.2.100.0080.00418.22
8.2.90.0040.00417.88
8.2.80.0080.00018.91
8.2.70.0080.00018.05
8.2.60.0060.00318.34
8.2.50.0040.00418.10
8.2.40.0000.00819.30
8.2.30.0020.00519.30
8.2.20.0050.00318.06
8.2.10.0040.00419.32
8.2.00.0040.00419.29
8.1.310.0030.00616.76
8.1.300.0040.00420.25
8.1.290.0040.00430.84
8.1.280.0150.00425.92
8.1.270.0080.00023.99
8.1.260.0110.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00619.27
8.1.230.0090.00320.88
8.1.220.0000.00818.67
8.1.210.0050.00318.77
8.1.200.0090.00017.47
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0060.00318.70
8.1.160.0070.00019.00
8.1.150.0070.00018.80
8.1.140.0000.00718.77
8.1.130.0070.00017.43
8.1.120.0070.00017.41
8.1.110.0040.00417.42
8.1.100.0040.00417.39
8.1.90.0040.00417.37
8.1.80.0000.00817.54
8.1.70.0030.00317.40
8.1.60.0060.00317.62
8.1.50.0030.00617.55
8.1.40.0030.00517.58
8.1.30.0040.00417.52
8.1.20.0040.00417.61
8.1.10.0040.00417.60
8.1.00.0000.00917.59
8.0.300.0070.00018.77
8.0.290.0050.00316.75
8.0.280.0030.00318.46
8.0.270.0040.00416.82
8.0.260.0030.00316.82
8.0.250.0030.00316.95
8.0.240.0040.00416.92
8.0.230.0050.00317.02
8.0.220.0030.00316.92
8.0.210.0050.00517.01
8.0.200.0030.00317.06
8.0.190.0050.00217.08
8.0.180.0030.00517.01
8.0.170.0030.00616.98
8.0.160.0000.00817.00
8.0.150.0000.00716.75
8.0.140.0000.00716.92
8.0.130.0030.00313.38
8.0.120.0070.00016.84
8.0.110.0050.00216.85
8.0.100.0000.00716.95
8.0.90.0000.00716.98
8.0.80.0050.01016.96
8.0.70.0000.00717.02
8.0.60.0050.00317.04
8.0.50.0030.00516.79
8.0.30.0140.00317.10
8.0.20.0110.00717.45
8.0.10.0040.00417.06
8.0.00.0110.01016.75
7.4.330.0050.00015.55
7.4.320.0060.00016.56
7.4.300.0040.00416.63
7.4.290.0050.00316.57
7.4.280.0000.00716.47
7.4.270.0000.00716.58
7.4.260.0040.00413.29
7.4.250.0000.00816.48
7.4.240.0000.00716.64
7.4.230.0000.00716.61
7.4.220.0020.00516.68
7.4.210.0090.00916.61
7.4.200.0040.00416.52
7.4.130.0080.01716.54
7.4.120.0160.01016.55
7.4.110.0190.00916.63
7.4.100.0100.01316.69
7.4.90.0100.01016.56
7.4.80.0130.00916.52
7.4.70.0150.00916.55
7.4.60.0060.01516.48
7.4.50.0100.01616.58
7.4.40.0150.00916.68
7.4.30.0130.01016.59
7.4.20.0100.01316.34
7.4.10.0110.01116.51
7.4.00.0150.00616.67
7.3.330.0030.00316.48
7.3.320.0060.00013.46
7.3.310.0030.00316.41
7.3.300.0000.00616.26
7.3.290.0110.00616.45
7.3.260.0090.00616.66
7.3.250.0090.01316.58
7.3.240.0100.01416.29
7.3.230.0130.01016.57
7.3.220.0060.01616.51
7.3.210.0090.01216.33
7.3.200.0120.01216.41
7.3.190.0120.00916.47
7.3.180.0100.01016.45
7.3.170.0130.01316.45
7.3.160.0200.00316.30
7.3.150.0060.01516.49
7.3.140.0210.00616.22
7.3.130.0130.01216.49
7.3.120.0070.01516.64
7.3.110.0120.00916.48
7.3.100.0000.02216.34
7.3.90.0100.01416.41
7.3.80.0040.01616.52
7.3.70.0030.01716.47
7.3.60.0160.00916.39
7.3.50.0100.01016.41
7.3.40.0140.00916.55
7.3.30.0040.01816.38
7.3.20.0160.00616.63
7.3.10.0130.00716.58
7.3.00.0120.00916.45

preferences:
32.37 ms | 403 KiB | 5 Q