3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 'user_id' => 10, 'id' => 2, 'user' => 'Nakiya', ); /** * Check if an item is in an array. */ function contains($array, $value) { return in_array($value, $array, true); } $result_1 = contains($array,'Nakiya'); echo "item available =>"; if($result_1){ echo "success"; }else{ echo "fail"; } echo " item not available =>"; $result_2 = contains($array,'Nakiya10'); if($result_2){ echo "success <br>"; }else{ echo "fail"; }

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.66
8.4.20.0130.00718.95
8.4.10.0090.00017.45
8.3.160.0000.01816.98
8.3.150.0110.00817.12
8.3.140.0030.00620.88
8.3.130.0070.00316.63
8.3.120.0090.00020.45
8.3.110.0090.00020.94
8.3.100.0130.00318.46
8.3.90.0040.00418.05
8.3.80.0000.00918.31
8.3.70.0080.01118.36
8.3.60.0110.00716.63
8.3.50.0070.00719.28
8.3.40.0140.00018.63
8.3.30.0090.00618.59
8.3.20.0000.00720.83
8.3.10.0040.00421.79
8.3.00.0040.00420.64
8.2.270.0120.00617.17
8.2.260.0070.01118.32
8.2.250.0000.00716.86
8.2.240.0040.00418.71
8.2.230.0100.00022.58
8.2.220.0090.00024.06
8.2.210.0090.00926.77
8.2.200.0030.00618.41
8.2.190.0070.01116.58
8.2.180.0110.00718.41
8.2.170.0090.00622.96
8.2.160.0110.00422.07
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0030.00626.16
8.2.110.0050.00521.10
8.2.100.0040.00817.84
8.2.90.0030.00522.27
8.2.80.0050.00317.97
8.2.70.0060.00317.92
8.2.60.0040.00418.16
8.2.50.0050.00318.10
8.2.40.0040.00419.34
8.2.30.0040.00419.27
8.2.20.0020.00517.88
8.2.10.0000.00719.13
8.2.00.0000.00719.28
8.1.310.0170.00015.89
8.1.300.0090.00018.55
8.1.290.0090.00018.88
8.1.280.0070.00725.92
8.1.270.0080.00023.81
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00621.18
8.1.230.0090.00321.04
8.1.220.0000.00817.75
8.1.210.0000.00818.82
8.1.200.0030.00617.00
8.1.190.0090.00017.11
8.1.180.0110.00018.10
8.1.170.0030.00620.82
8.1.160.0000.00718.93
8.1.150.0030.00318.73
8.1.140.0000.00720.24
8.1.130.0070.00020.00
8.1.120.0030.00617.41
8.1.110.0070.00317.38
8.1.100.0030.00317.39
8.1.90.0000.00817.31
8.1.80.0050.00217.39
8.1.70.0030.00317.39
8.1.60.0080.00017.55
8.1.50.0050.00317.55
8.1.40.0030.00517.52
8.1.30.0050.00317.72
8.1.20.0030.00617.61
8.1.10.0090.00017.51
8.1.00.0000.00817.41
8.0.300.0000.00719.92
8.0.290.0000.00916.63
8.0.280.0000.00718.36
8.0.270.0080.00017.28
8.0.260.0030.00320.06
8.0.250.0030.00316.86
8.0.240.0070.00316.93
8.0.230.0070.00016.88
8.0.220.0070.00016.84
8.0.210.0000.00816.77
8.0.200.0030.00316.91
8.0.190.0000.00716.89
8.0.180.0000.00816.83
8.0.170.0030.00516.91
8.0.160.0000.00716.85
8.0.150.0070.00016.77
8.0.140.0050.00316.80
8.0.130.0050.00013.23
8.0.120.0080.00016.77
8.0.110.0050.00216.87
8.0.100.0000.00816.89
8.0.90.0030.00616.84
8.0.80.0160.00016.88
8.0.70.0000.00816.73
8.0.60.0050.00316.68
8.0.50.0020.00516.95
8.0.30.0100.01316.99
8.0.20.0090.01016.92
8.0.10.0040.00416.95
8.0.00.0070.01117.06
7.4.330.0000.00415.55
7.4.320.0030.00316.36
7.4.300.0030.00316.46
7.4.290.0000.00716.61
7.4.280.0040.00416.60
7.4.270.0000.00816.45
7.4.260.0050.00216.60
7.4.250.0030.00516.41
7.4.240.0020.00516.60
7.4.230.0030.00316.49
7.4.220.0000.00716.55
7.4.210.0100.00916.58
7.4.200.0000.00716.40
7.4.130.0060.01316.43
7.4.120.0160.00716.32
7.4.110.0130.00616.52
7.4.100.0130.00716.37
7.4.90.0070.01016.24
7.4.80.0130.00519.39
7.4.70.0160.00016.43
7.4.60.0140.00316.52
7.4.50.0030.01216.45
7.4.40.0100.00716.54
7.4.10.0140.00714.70
7.4.00.0090.00514.78
7.3.330.0000.00716.23
7.3.320.0000.00513.23
7.3.310.0000.00716.07
7.3.300.0040.00416.27
7.3.290.0040.00416.25
7.3.260.0090.01016.44
7.3.240.0110.00616.45
7.3.230.0070.01416.41
7.3.210.0100.01016.28
7.3.200.0070.01016.30
7.3.190.0110.00716.30
7.3.180.0100.00616.19
7.3.170.0100.01016.43
7.3.160.0120.01116.46
7.3.130.0090.01214.96
7.3.120.0100.00714.94
7.3.110.0070.01114.96
7.3.100.0110.00314.93
7.3.90.0110.00514.82
7.3.80.0090.00314.76
7.3.70.0030.00814.78
7.3.60.0100.00414.70
7.3.50.0030.00814.66
7.3.40.0100.00514.75
7.3.30.0040.01114.79
7.3.20.0060.00815.64
7.3.10.0100.00515.67
7.3.00.0080.01015.73
7.2.330.0120.00616.57
7.2.320.0070.01016.60
7.2.310.0130.00416.61
7.2.300.0160.00016.46
7.2.290.0160.00016.54
7.2.260.0070.01115.18
7.2.250.0040.00714.77
7.2.240.0040.01215.22
7.2.230.0040.01014.86
7.2.220.0090.00414.79
7.2.210.0030.01015.09
7.2.200.0030.00914.77
7.2.190.0070.00815.04
7.2.180.0070.01015.09
7.2.170.0020.01115.01
7.2.160.0080.00815.01
7.2.150.0070.00815.99
7.2.140.0120.00216.02
7.2.130.0090.01215.90
7.2.120.0120.01215.84
7.2.110.0100.00615.80
7.2.100.0080.00915.96
7.2.90.0070.00815.84
7.2.80.0040.00915.92
7.2.70.0050.00916.01
7.2.60.0070.00715.95
7.2.50.0020.01516.09
7.2.40.0080.00615.96
7.2.30.0060.00916.10
7.2.20.0020.01115.95
7.2.10.0090.00315.94
7.2.00.0050.00616.00
7.1.330.0040.01215.54
7.1.320.0100.00514.75
7.1.310.0080.00314.93
7.1.300.0070.00714.85
7.1.290.0070.00914.84
7.1.280.0070.00714.86
7.1.270.0020.01214.96
7.1.260.0060.00614.79
7.1.250.0100.00714.78
7.1.240.0000.01315.69
7.1.230.0050.01015.86
7.1.220.0000.01815.67
7.1.210.0070.01015.78
7.1.200.0030.01015.41
7.1.190.0070.01015.64
7.1.180.0030.00815.90
7.1.170.0060.00915.61
7.1.160.0070.00715.82
7.1.150.0030.00615.82
7.1.140.0040.00815.64
7.1.130.0000.01315.60
7.1.120.0090.00315.89
7.1.110.0030.01015.94
7.1.100.0030.01015.93
7.1.90.0030.01015.79
7.1.80.0030.00615.48
7.1.70.0110.00415.93
7.1.60.0070.00415.82
7.1.50.0030.01015.43
7.1.40.0040.01115.79
7.1.30.0000.01215.71
7.1.20.0000.01315.58
7.1.10.0030.01015.96
7.1.00.0030.00615.79

preferences:
34.48 ms | 403 KiB | 5 Q