3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array( 'Field1' => 'red', 'Field2' => 'green', 'Field3' => 'blue' ), array( 'Field1' => 'pink', 'Field2' => 'pinkish', 'Field3' => 'barbiecolor' ), array( 'Field1' => 'red', 'Field2' => 'blue', ' Field3' => 'orange' ) ); $searchBy = array( 'Field1' => 'red', 'Field2' => 'blue' ); // use($searchBy) function find($needle, $haystack) { $r = array(); foreach ( $haystack as $k => $a ) { array_intersect_assoc($needle, $a) == $needle and $r[$k] = $a; } return $r; } $find = find($searchBy, $array); print_r($find); ?>

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.120.0110.00920.69
8.4.110.0050.00320.79
8.4.100.0140.00717.65
8.4.90.0140.00617.65
8.4.80.0090.00817.77
8.4.70.0090.01018.07
8.4.60.0090.00719.15
8.4.50.0060.01324.01
8.4.40.0130.00717.44
8.4.30.0060.01517.82
8.4.20.0100.01017.73
8.4.10.0060.00317.74
8.3.250.0090.01018.92
8.3.240.0080.01116.80
8.3.230.0120.00716.64
8.3.220.0100.00616.74
8.3.210.0130.00716.41
8.3.200.0050.00316.89
8.3.190.0070.00817.13
8.3.180.0130.00617.09
8.3.170.0100.01017.41
8.3.160.0130.00718.46
8.3.150.0040.01116.73
8.3.140.0050.00516.61
8.3.130.0040.00418.34
8.3.120.0160.00020.74
8.3.110.0070.00320.94
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0090.00019.36
8.3.70.0120.00318.43
8.3.60.0100.01016.61
8.3.50.0130.00616.55
8.3.40.0040.01318.66
8.3.30.0090.00618.84
8.3.20.0090.00018.50
8.3.10.0080.00020.57
8.3.00.0070.00417.50
8.2.290.0080.00718.89
8.2.280.0120.00718.45
8.2.270.0090.00917.35
8.2.260.0150.00018.19
8.2.250.0060.00318.46
8.2.240.0030.00617.28
8.2.230.0080.00822.58
8.2.220.0030.00637.54
8.2.210.0040.00426.77
8.2.200.0090.00018.88
8.2.190.0110.00316.63
8.2.180.0120.00616.63
8.2.170.0100.01022.96
8.2.160.0070.00722.16
8.2.150.0050.00224.18
8.2.140.0030.00724.66
8.2.130.0070.00026.16
8.2.120.0000.00719.83
8.2.110.0090.00020.52
8.2.100.0030.01320.38
8.2.90.0030.00617.62
8.2.80.0030.00618.91
8.2.70.0040.00417.63
8.2.60.0030.00617.75
8.2.50.0000.00817.75
8.2.40.0000.00919.43
8.2.30.0020.00517.63
8.2.20.0000.00717.63
8.2.10.0060.00317.63
8.2.00.0080.00017.63
8.1.330.0120.00616.34
8.1.320.0140.00716.41
8.1.310.0000.00718.23
8.1.300.0030.00619.71
8.1.290.0060.00330.84
8.1.280.0070.01125.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.05
8.1.230.0090.00320.29
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0030.00618.10
8.1.170.0040.00417.62
8.1.160.0000.00718.90
8.1.150.0040.00418.56
8.1.140.0000.00717.50
8.1.130.0050.00317.75
8.1.120.0020.00517.38
8.1.110.0070.00017.39
8.1.100.0000.00717.32
8.1.90.0040.00417.42
8.1.80.0000.00717.52
8.1.70.0040.00417.44
8.1.60.0050.00317.63
8.1.50.0000.00917.36
8.1.40.0030.00617.48
8.1.30.0040.00417.66
8.1.20.0040.00417.53
8.1.10.0080.00017.54
8.1.00.0000.00817.47
8.0.300.0000.00819.64
8.0.290.0040.00416.75
8.0.280.0040.00417.93
8.0.270.0060.00318.09
8.0.260.0000.00616.93
8.0.250.0040.00416.95
8.0.240.0070.00416.95
8.0.230.0070.00016.89
8.0.220.0070.00016.92
8.0.210.0030.00616.89
8.0.200.0000.00716.96
8.0.190.0050.00516.97
8.0.180.0040.00416.93
8.0.170.0060.00316.92
8.0.160.0040.00416.86
8.0.150.0000.00716.88
8.0.140.0020.00516.88
8.0.130.0000.00513.32
8.0.120.0040.00416.74
8.0.110.0030.00316.76
8.0.100.0070.00016.68
8.0.90.0040.00416.95
8.0.80.0030.01016.86
8.0.70.0040.00416.89
8.0.60.0040.00416.96
8.0.50.0040.00417.01
8.0.30.0150.00717.09
8.0.20.0070.01116.99
8.0.10.0040.00417.04
8.0.00.0100.00816.85
7.4.330.0000.00512.92
7.4.320.0050.00316.58
7.4.300.0000.00616.59
7.4.290.0030.00316.50
7.4.280.0040.00416.42
7.4.270.0040.00416.63
7.4.260.0000.00513.27
7.4.250.0040.00416.49
7.4.240.0030.00316.44
7.4.230.0070.00016.32
7.4.220.0090.00916.46
7.4.210.0070.00916.55
7.4.200.0000.00816.47
7.4.190.0030.00316.41
7.4.160.0060.01016.30
7.4.150.0070.01016.46
7.4.140.0050.01416.42
7.4.130.0060.01116.40
7.4.120.0090.01016.56
7.4.110.0060.01016.53
7.4.100.0060.01016.54
7.4.90.0060.01116.45
7.4.80.0110.00716.67
7.4.70.0060.01016.64
7.4.60.0090.00916.42
7.4.50.0020.00216.15
7.4.40.0000.01516.36
7.4.30.0090.00916.66
7.4.00.0080.00914.88
7.3.330.0030.00313.33
7.3.320.0000.00713.33
7.3.310.0040.00416.22
7.3.300.0000.00616.37
7.3.290.0140.00016.37
7.3.280.0050.01216.36
7.3.270.0030.01316.43
7.3.260.0080.01016.43
7.3.250.0110.00916.39
7.3.240.0140.00716.69
7.3.230.0170.00316.48
7.3.210.0100.00616.55
7.3.200.0040.01319.39
7.3.190.0100.00716.38
7.3.180.0080.00816.32
7.3.170.0100.00716.71
7.3.160.0110.00416.52
7.3.120.0080.00914.96
7.3.110.0110.00514.87
7.3.100.0060.00714.71
7.3.90.0060.00914.83
7.3.80.0070.00914.57
7.3.70.0040.00714.74
7.3.60.0050.00814.78
7.3.50.0080.00814.75
7.3.40.0060.00614.73
7.3.30.0050.01114.83
7.3.20.0050.00816.74
7.3.10.0070.00716.85
7.3.00.0100.00216.76
7.2.330.0070.01116.76
7.2.320.0110.00716.73
7.2.310.0200.00316.43
7.2.300.0030.01416.73
7.2.290.0070.01516.80
7.2.250.0110.00715.04
7.2.240.0110.01015.19
7.2.230.0070.00915.29
7.2.220.0070.00714.75
7.2.210.0100.00314.99
7.2.200.0050.00515.13
7.2.190.0030.01114.98
7.2.180.0070.00815.04
7.2.170.0060.00414.90
7.2.00.0030.01019.57
7.1.330.0070.00915.69
7.1.320.0030.00815.91
7.1.310.0110.00315.72
7.1.300.0030.01215.76
7.1.290.0060.00715.83
7.1.280.0050.00915.85
7.1.270.0070.00915.88
7.1.260.0050.00715.81
7.1.100.0040.00818.36
7.1.70.0040.00417.15
7.1.60.0120.01219.40
7.1.50.0090.01516.94
7.1.00.0030.07322.35
7.0.200.0230.01014.72
7.0.140.0000.07722.04
7.0.120.0000.07022.15
7.0.60.0070.04021.74
7.0.50.0070.07717.72
7.0.40.0030.05320.10
7.0.30.0270.07720.30
7.0.20.0370.07020.10
7.0.10.0170.08020.16
7.0.00.0070.04020.33
5.6.280.0030.07321.04
5.6.210.0100.08320.71
5.6.200.0070.07718.16
5.6.190.0070.09020.48
5.6.180.0170.05320.50
5.6.170.0230.04720.58
5.6.160.0100.07020.55
5.6.150.0130.07318.12
5.6.140.0130.08018.33
5.6.130.0100.04718.27
5.6.120.0070.06020.98
5.6.110.0070.08721.02
5.6.100.0070.08321.14
5.6.90.0100.08020.88
5.6.80.0030.04020.42
5.5.350.0170.04020.47
5.5.340.0100.03718.00
5.5.330.0030.08720.30
5.5.320.0270.04020.30
5.5.310.0230.05720.38
5.5.300.0070.03718.01
5.5.290.0130.06717.96
5.5.280.0030.04020.69
5.5.270.0100.08720.87
5.5.260.0070.04720.73
5.5.250.0030.04320.71
5.5.240.0200.07720.25
5.4.450.0070.04319.57
5.4.440.0070.04319.18
5.4.430.0070.06019.16
5.4.420.0100.07319.52
5.4.410.0030.07019.18
5.4.400.0100.04318.96
5.4.390.0070.07019.23
5.4.380.0030.08319.24
5.4.370.0100.07718.97
5.4.360.0030.07318.98
5.4.350.0070.06018.98
5.4.340.0070.07018.97
5.4.320.0070.07719.14
5.4.310.0100.06719.00
5.4.300.0100.04318.97
5.4.290.0100.06719.14
5.4.280.0130.04719.14
5.4.270.0000.05019.07
5.4.260.0070.06318.85
5.4.250.0030.07719.11
5.4.240.0070.06018.87
5.4.230.0100.06319.07
5.4.220.0070.07719.24
5.4.210.0100.07319.14
5.4.200.0000.07018.97
5.4.190.0070.04718.96
5.4.180.0200.05319.07
5.4.170.0030.08018.99
5.4.160.0030.05718.98
5.4.150.0130.04718.85
5.4.140.0100.04016.43
5.4.130.0100.04316.54
5.4.120.0070.05316.23
5.4.110.0100.07716.67
5.4.100.0000.05716.45
5.4.90.0100.06316.28
5.4.80.0100.06716.46
5.4.70.0000.05716.25
5.4.60.0100.05016.37
5.4.50.0070.06716.34
5.4.40.0170.03316.27
5.4.30.0000.07716.33
5.4.20.0000.04016.38
5.4.10.0030.05316.50
5.4.00.0030.04315.82
5.3.290.0100.07314.72
5.3.280.0100.07014.60
5.3.270.0070.03714.64
5.3.260.0000.08314.60
5.3.250.0070.04314.63
5.3.240.0100.07014.49
5.3.230.0100.04014.67
5.3.220.0170.06714.60
5.3.210.0070.06014.49
5.3.200.0030.07314.61
5.3.190.0000.05314.58
5.3.180.0030.05014.71
5.3.170.0070.06714.73
5.3.160.0000.05314.57
5.3.150.0100.03314.48
5.3.140.0030.05014.62
5.3.130.0070.06314.56
5.3.120.0030.05014.59
5.3.110.0030.04014.58
5.3.100.0130.05314.03
5.3.90.0070.06313.91
5.3.80.0070.06713.98
5.3.70.0070.07014.01
5.3.60.0070.05013.95
5.3.50.0100.07313.95
5.3.40.0070.07013.96
5.3.30.0100.07313.97
5.3.20.0100.06713.71
5.3.10.0000.04313.67
5.3.00.0070.04313.80
5.2.170.0000.04311.13
5.2.160.0030.05311.04
5.2.150.0030.03711.11
5.2.140.0070.05711.20
5.2.130.0100.03011.00
5.2.120.0070.06711.14
5.2.110.0000.04011.13
5.2.100.0030.06311.12
5.2.90.0030.03311.01
5.2.80.0030.07011.24
5.2.70.0030.07011.24
5.2.60.0070.05711.09
5.2.50.0070.03710.94
5.2.40.0070.03011.05
5.2.30.0030.06011.13
5.2.20.0070.04311.11
5.2.10.0070.05710.86
5.2.00.0070.06310.75
5.1.60.0100.03710.06
5.1.50.0030.05310.02
5.1.40.0070.0239.95
5.1.30.0030.03010.25
5.1.20.0130.04310.52
5.1.10.0000.05010.21
5.1.00.0030.03710.02
5.0.50.0100.0178.61
5.0.40.0030.0308.47
5.0.30.0070.0578.38
5.0.20.0030.0338.11
5.0.10.0030.0238.08
5.0.00.0000.0378.09
4.4.90.0000.0277.79
4.4.80.0000.0277.79
4.4.70.0030.0207.79
4.4.60.0000.0237.79
4.4.50.0000.0407.79
4.4.40.0030.0477.79
4.4.30.0030.0377.79
4.4.20.0000.0377.79
4.4.10.0130.0237.79
4.4.00.0070.0537.79
4.3.110.0000.0377.79
4.3.100.0030.0377.79
4.3.90.0000.0337.79
4.3.80.0000.0277.79
4.3.70.0030.0207.79
4.3.60.0000.0377.79
4.3.50.0000.0307.79
4.3.40.0030.0507.79
4.3.30.0030.0307.79
4.3.20.0000.0237.79
4.3.10.0000.0407.79
4.3.00.0030.0307.79

preferences:
28.71 ms | 403 KiB | 5 Q