3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Check if an array contains any value in a set. ** * @param array $array * @param array $subset * @param bool $strict Strict type checking * @return bool */ $a=array(1,'test'); $b=array(2,'test'); function array_contains_any_val(array $array, array $subset, bool $strict = false) :bool { $contains = false; foreach ($subset as $value) { if (in_array($value, $array, $strict)) { $contains = true; break; } } return $contains; } var_dump(array_contains_any_val($a, $b));

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.0110.00920.55
8.4.20.0070.01318.77
8.4.10.0040.00417.80
8.3.160.0110.00716.98
8.3.150.0110.00717.09
8.3.140.0050.00320.91
8.3.130.0100.00716.41
8.3.120.0060.00318.93
8.3.110.0050.00320.94
8.3.100.0060.00324.06
8.3.90.0100.00726.77
8.3.80.0060.00316.63
8.3.70.0070.00716.75
8.3.60.0130.00918.55
8.3.50.0080.01219.01
8.3.40.0150.00618.66
8.3.30.0090.00618.73
8.3.20.0050.00322.41
8.3.10.0060.00921.80
8.3.00.0080.00022.40
8.2.270.0140.00416.96
8.2.260.0030.01417.16
8.2.250.0110.00417.03
8.2.240.0130.00618.84
8.2.230.0060.00322.58
8.2.220.0150.00437.54
8.2.210.0040.00426.77
8.2.200.0060.00316.75
8.2.190.0160.00618.29
8.2.180.0120.00318.16
8.2.170.0000.01422.96
8.2.160.0070.00720.53
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00026.16
8.2.110.0050.00520.49
8.2.100.0090.00317.91
8.2.90.0000.00817.75
8.2.80.0050.00317.97
8.2.70.0050.00317.80
8.2.60.0090.00018.22
8.2.50.0000.00818.10
8.2.40.0030.00621.04
8.2.30.0000.00719.18
8.2.20.0040.00417.97
8.2.10.0050.00319.23
8.2.00.0040.00419.10
8.1.310.0160.00316.79
8.1.300.0000.01017.92
8.1.290.0030.00618.88
8.1.280.0130.01025.92
8.1.270.0000.00822.51
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0030.00623.97
8.1.230.0080.00419.15
8.1.220.0050.00317.74
8.1.210.0040.00420.88
8.1.200.0030.00617.35
8.1.190.0050.00317.22
8.1.180.0030.00518.10
8.1.170.0000.00820.72
8.1.160.0000.00718.91
8.1.150.0080.00018.89
8.1.140.0000.00720.19
8.1.130.0000.00720.06
8.1.120.0000.00717.43
8.1.110.0040.00417.49
8.1.100.0050.00317.45
8.1.90.0000.01017.44
8.1.80.0050.00317.52
8.1.70.0000.00717.35
8.1.60.0030.00517.55
8.1.50.0010.00917.41
8.1.40.0000.00817.55
8.1.30.0050.00317.54
8.1.20.0000.00817.58
8.1.10.0060.00317.48
8.1.00.0060.00617.41
8.0.300.0000.00819.78
8.0.290.0090.00016.75
8.0.280.0040.00418.52
8.0.270.0030.00316.74
8.0.260.0000.00620.15
8.0.250.0000.00716.93
8.0.240.0030.00516.95
8.0.230.0040.00416.80
8.0.220.0000.00816.93
8.0.210.0040.00416.78
8.0.200.0040.00416.86
8.0.190.0020.00516.84
8.0.180.0040.00416.92
8.0.170.0070.00416.98
8.0.160.0000.00716.96
8.0.150.0030.00316.77
8.0.140.0000.00716.88
8.0.130.0000.00613.40
8.0.120.0040.00416.73
8.0.110.0000.00716.83
8.0.100.0040.00416.88
8.0.90.0060.00316.98
8.0.80.0070.00716.98
8.0.70.0040.00416.71
8.0.60.0000.00716.73
8.0.50.0040.00416.92
8.0.30.0110.00517.15
8.0.20.0030.01616.95
8.0.10.0040.00417.05
8.0.00.0120.00616.81
7.4.330.0000.00415.55
7.4.320.0000.00616.50
7.4.300.0000.00716.53
7.4.290.0030.00316.60
7.4.280.0040.00416.43
7.4.270.0060.00016.47
7.4.260.0040.00416.50
7.4.250.0030.00316.61
7.4.240.0030.00316.59
7.4.230.0000.00716.30
7.4.220.0020.00516.55
7.4.210.0030.01116.53
7.4.200.0030.00516.63
7.4.130.0170.00716.45
7.4.120.0000.02016.63
7.4.110.0030.01416.43
7.4.100.0070.01116.75
7.4.90.0150.00916.61
7.4.80.0090.00919.39
7.4.70.0130.01016.50
7.4.60.0060.01216.64
7.4.50.0080.00816.53
7.4.40.0100.00616.45
7.4.10.0060.01314.82
7.4.00.0030.01214.81
7.3.330.0030.00316.33
7.3.320.0030.00313.39
7.3.310.0000.00716.11
7.3.300.0020.00516.18
7.3.290.0030.00316.33
7.3.260.0100.00816.46
7.3.240.0100.00816.52
7.3.230.0030.01316.58
7.3.210.0100.00616.29
7.3.200.0140.00416.39
7.3.190.0100.01016.44
7.3.180.0080.00816.29
7.3.170.0130.00316.26
7.3.160.0030.01416.30
7.3.130.0110.00614.89
7.3.120.0070.01015.13
7.3.110.0090.00915.02
7.3.100.0070.00614.65
7.3.90.0080.00714.55
7.3.80.0060.00814.54
7.3.70.0060.00514.69
7.3.60.0100.00614.86
7.3.50.0050.01014.75
7.3.40.0040.00914.79
7.3.30.0040.00914.86
7.3.20.0060.00815.88
7.3.10.0090.00615.63
7.3.00.0030.01315.49
7.2.330.0110.01016.63
7.2.320.0030.01516.70
7.2.310.0100.00716.51
7.2.300.0090.00916.40
7.2.290.0080.00816.66
7.2.260.0000.02114.93
7.2.250.0030.01014.97
7.2.240.0060.00615.02
7.2.230.0060.01114.92
7.2.220.0060.00614.98
7.2.210.0030.01114.98
7.2.200.0050.00915.14
7.2.190.0060.00615.05
7.2.180.0080.00415.02
7.2.170.0050.00914.87
7.2.160.0080.00614.96
7.2.150.0110.00315.99
7.2.140.0100.00815.73
7.2.130.0060.00915.79
7.2.120.0030.01115.80
7.2.110.0060.01016.03
7.2.100.0050.01015.97
7.2.90.0090.01116.03
7.2.80.0100.00515.96
7.2.70.0050.00815.97
7.2.60.0060.00916.08
7.2.50.0070.00515.76
7.2.40.0090.00516.01
7.2.30.0060.00615.72
7.2.20.0070.00916.01
7.2.10.0050.00715.83
7.2.00.0070.00816.01
7.1.330.0060.00615.97
7.1.320.0050.00914.99
7.1.310.0080.00514.93
7.1.300.0110.00514.74
7.1.290.0080.00314.85
7.1.280.0110.00314.63
7.1.270.0110.00414.81
7.1.260.0080.00814.91
7.1.250.0090.00614.63
7.1.240.0000.00916.02
7.1.230.0100.00615.98
7.1.220.0060.01215.93
7.1.210.0000.01315.73
7.1.200.0040.00615.71
7.1.190.0080.00415.86
7.1.180.0000.00915.82
7.1.170.0080.00815.85
7.1.160.0050.00515.64
7.1.150.0070.00715.53
7.1.140.0100.00615.74
7.1.130.0000.01215.86
7.1.120.0060.00616.02
7.1.110.0090.00615.82
7.1.100.0110.00315.90
7.1.90.0000.01515.96
7.1.80.0110.00416.00
7.1.70.0070.00715.97
7.1.60.0060.00915.93
7.1.50.0090.00615.96
7.1.40.0060.00916.02
7.1.30.0000.01315.80
7.1.20.0030.00915.98
7.1.10.0110.00415.70
7.1.00.0030.00915.59

preferences:
36.36 ms | 403 KiB | 5 Q