3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = Array ( 'user_id' => 10, 'id' => 2, 'user' => 'Nakiya', ); $b = Array ( 'user_id' => 10, 'id' => 7, 'user' => 'Nakiya', ); /** * Return an array with all elements found in both input arrays. */ function intersection($a, $b) { $a = (array) $a; $b = (array) $b; return array_values(array_intersect($a, $b)); } $arr =intersection($a, $b); print_r($arr);

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.30.0070.01420.21
8.4.20.0100.01018.64
8.4.10.0080.00817.57
8.3.160.0100.01016.77
8.3.150.0110.00716.54
8.3.140.0180.00018.75
8.3.130.0000.00816.69
8.3.120.0120.00318.95
8.3.110.0040.00420.94
8.3.100.0120.00316.46
8.3.90.0110.00418.05
8.3.80.0090.00018.31
8.3.70.0210.00018.30
8.3.60.0030.01718.30
8.3.50.0190.00618.92
8.3.40.0100.00518.54
8.3.30.0070.00718.67
8.3.20.0040.00420.60
8.3.10.0080.00021.95
8.3.00.0000.00820.59
8.2.270.0110.00716.66
8.2.260.0150.00316.95
8.2.250.0040.00416.61
8.2.240.0000.01019.10
8.2.230.0090.00022.58
8.2.220.0040.00424.06
8.2.210.0040.00426.77
8.2.200.0080.00418.41
8.2.190.0110.00716.63
8.2.180.0110.01118.05
8.2.170.0060.00922.96
8.2.160.0060.00822.12
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0000.00726.16
8.2.120.0080.00026.16
8.2.110.0030.00621.10
8.2.100.0090.00317.72
8.2.90.0000.00720.54
8.2.80.0040.00417.97
8.2.70.0000.00817.80
8.2.60.0000.00818.09
8.2.50.0000.01118.10
8.2.40.0080.00019.34
8.2.30.0040.00419.06
8.2.20.0040.00417.97
8.2.10.0080.00019.25
8.2.00.0040.00419.22
8.1.310.0150.00316.55
8.1.300.0090.00018.06
8.1.290.0060.00318.88
8.1.280.0030.01025.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0080.00022.74
8.1.230.0080.00420.88
8.1.220.0000.00817.74
8.1.210.0060.00318.79
8.1.200.0060.00317.36
8.1.190.0050.00317.10
8.1.180.0080.00018.10
8.1.170.0050.00318.61
8.1.160.0040.00418.86
8.1.150.0000.01018.75
8.1.140.0000.00820.11
8.1.130.0000.00820.07
8.1.120.0070.00017.29
8.1.110.0040.00417.40
8.1.100.0030.00617.40
8.1.90.0070.00017.36
8.1.80.0030.00717.42
8.1.70.0070.00017.44
8.1.60.0000.00817.53
8.1.50.0050.00317.53
8.1.40.0060.00317.38
8.1.30.0030.00517.63
8.1.20.0000.00917.52
8.1.10.0060.00317.47
8.1.00.0040.00417.29
8.0.300.0040.00419.86
8.0.290.0000.00816.75
8.0.280.0000.00818.32
8.0.270.0030.00317.19
8.0.260.0000.00719.93
8.0.250.0020.00516.86
8.0.240.0070.00316.84
8.0.230.0030.00316.87
8.0.220.0030.00316.84
8.0.210.0030.00316.84
8.0.200.0040.00416.89
8.0.190.0000.00716.92
8.0.180.0040.00416.73
8.0.170.0040.00416.88
8.0.160.0000.00816.91
8.0.150.0030.00416.73
8.0.140.0090.00016.66
8.0.130.0000.00613.21
8.0.120.0000.00816.80
8.0.110.0070.00016.84
8.0.100.0000.00716.70
8.0.90.0030.00616.78
8.0.80.0000.01516.78
8.0.70.0000.00816.75
8.0.60.0000.00816.63
8.0.50.0050.00316.67
8.0.30.0080.01217.18
8.0.20.0140.00716.90
8.0.10.0000.00817.05
8.0.00.0100.00716.95
7.4.330.0030.00315.55
7.4.320.0000.00616.62
7.4.300.0030.00316.45
7.4.290.0030.00316.54
7.4.280.0070.00416.53
7.4.270.0080.00016.55
7.4.260.0080.00013.38
7.4.250.0000.00716.56
7.4.240.0010.00616.51
7.4.230.0000.00716.59
7.4.220.0020.00516.64
7.4.210.0120.00616.57
7.4.200.0000.00716.54
7.4.130.0140.00316.26
7.4.120.0190.00316.47
7.4.110.0040.01716.46
7.4.100.0200.00416.50
7.4.90.0140.01016.34
7.4.80.0030.01319.39
7.4.70.0070.01016.47
7.4.60.0180.00016.54
7.4.50.0100.00316.39
7.4.40.0090.00716.58
7.4.00.0080.00715.06
7.3.330.0050.00316.39
7.3.320.0030.00313.12
7.3.310.0050.00216.19
7.3.300.0040.00416.31
7.3.290.0030.00316.19
7.3.280.0240.00716.22
7.3.260.0120.00816.35
7.3.240.0100.00816.47
7.3.230.0080.00816.51
7.3.210.0130.00516.25
7.3.200.0070.00816.35
7.3.190.0120.00316.54
7.3.180.0100.00716.42
7.3.170.0120.00416.29
7.3.160.0120.00316.30
7.3.120.0060.01214.68
7.3.110.0060.01214.52
7.3.100.0090.00714.81
7.3.90.0080.00814.74
7.3.80.0050.00614.68
7.3.70.0060.00814.47
7.3.60.0060.00814.59
7.3.50.0050.00914.51
7.3.40.0090.00514.56
7.3.30.0090.00514.59
7.3.20.0080.00616.64
7.3.10.0080.00416.62
7.3.00.0070.00716.49
7.2.330.0070.01016.59
7.2.320.0110.00716.58
7.2.310.0140.01016.59
7.2.300.0150.00716.75
7.2.290.0090.01216.70
7.2.250.0080.01214.87
7.2.240.0110.00614.93
7.2.230.0120.00215.03
7.2.220.0030.01414.95
7.2.210.0100.00714.89
7.2.200.0050.01014.71
7.2.190.0020.01014.90
7.2.180.0090.00514.96
7.2.170.0030.01214.71
7.2.160.0040.01114.97
7.2.150.0060.00916.64
7.2.140.0120.00616.81
7.2.130.0030.01016.68
7.2.120.0060.00916.76
7.2.110.0070.01016.86
7.2.100.0060.00916.71
7.2.90.0060.00916.95
7.2.80.0030.01117.03
7.2.70.0030.01016.86
7.2.60.0060.00916.99
7.2.50.0040.01116.80
7.2.40.0040.01116.80
7.2.30.0100.00616.96
7.2.20.0090.00916.73
7.2.10.0030.01016.79
7.2.00.0100.00416.94
7.1.330.0100.00315.62
7.1.320.0090.00615.86
7.1.310.0060.00815.70
7.1.300.0080.00415.76
7.1.290.0060.00915.55
7.1.280.0080.00515.70
7.1.270.0020.01215.67
7.1.260.0060.00815.74
7.1.250.0060.00615.82

preferences:
28.7 ms | 403 KiB | 5 Q