3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = []; $ar['ar0']['y'] = 'Yes'; $ar['ar0']['n'] = 'No'; $ar['ar1']['g'] = 'good'; $ar['ar1']['b'] = 'bad'; $ar['ar2']['m'] = 'mom'; $ar['ar2']['d'] = 'dad'; $ar['ar4']['y'] = 'Yes'; $ar['ar4']['n'] = 'No'; print_r($ar); $res_ar = []; // resultant array function getArrayByKey($needle, $haystack) { foreach ($haystack as $arr) { if (in_array($needle, $arr)) { return $arr; } } return []; } $res_ar = getArrayByKey('Yes', $ar); print_r($res_ar);

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.3.60.0080.00818.43
8.3.50.0000.01617.89
8.3.40.0150.00018.65
8.3.30.0100.00718.54
8.3.20.0040.00420.87
8.3.10.0040.00421.85
8.3.00.0000.00820.75
8.2.180.0090.00618.17
8.2.170.0070.00722.96
8.2.160.0140.00022.08
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0060.00321.07
8.2.100.0000.01119.41
8.2.90.0060.00317.72
8.2.80.0070.00020.48
8.2.70.0000.00818.04
8.2.60.0000.00818.16
8.2.50.0040.00418.10
8.2.40.0040.00422.40
8.2.30.0070.00019.39
8.2.20.0070.00018.13
8.2.10.0000.00718.94
8.2.00.0000.00719.20
8.1.280.0080.00825.92
8.1.270.0030.00320.74
8.1.260.0050.00326.35
8.1.250.0060.00328.09
8.1.240.0040.00422.02
8.1.230.0090.00320.91
8.1.220.0060.00317.74
8.1.210.0080.00018.88
8.1.200.0050.00717.35
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0030.00518.98
8.1.160.0000.00920.16
8.1.150.0000.00718.82
8.1.140.0040.00418.92
8.1.130.0000.00720.21
8.1.120.0000.00717.54
8.1.110.0080.00017.46
8.1.100.0040.00417.46
8.1.90.0040.00417.52
8.1.80.0000.00717.53
8.1.70.0020.00517.45
8.1.60.0000.00917.57
8.1.50.0040.00417.50
8.1.40.0030.00517.54
8.1.30.0040.00417.73
8.1.20.0080.00017.63
8.1.10.0050.00217.57
8.1.00.0080.00017.29
8.0.300.0000.00720.14
8.0.290.0040.00416.75
8.0.280.0000.00718.33
8.0.270.0000.00716.88
8.0.260.0040.00420.09
8.0.250.0100.00016.85
8.0.240.0000.00616.87
8.0.230.0070.00016.90
8.0.220.0070.00316.78
8.0.210.0030.00316.89
8.0.200.0070.00016.99
8.0.190.0040.00417.03
8.0.180.0030.00516.99
8.0.170.0060.00316.96
8.0.160.0040.00416.87
8.0.150.0070.00016.73
8.0.140.0040.00416.76
8.0.130.0000.00513.43
8.0.120.0000.00716.81
8.0.110.0040.00416.92
8.0.100.0040.00416.79
8.0.90.0090.00016.98
8.0.80.0090.00616.90
8.0.70.0000.00716.91
8.0.60.0050.00316.93
8.0.50.0040.00416.95
8.0.30.0220.00616.88
8.0.20.0150.00417.22
8.0.10.0050.00216.92
8.0.00.0140.01116.57
7.4.330.0000.00515.55
7.4.320.0030.00316.66
7.4.300.0000.00616.61
7.4.290.0050.00316.62
7.4.280.0040.00416.62
7.4.270.0000.00616.53
7.4.260.0050.00013.32
7.4.250.0000.00716.58
7.4.240.0060.00116.61
7.4.230.0000.00716.64
7.4.220.0020.00516.63
7.4.210.0120.00516.57
7.4.200.0070.00016.32
7.4.130.0070.01016.62
7.4.120.0040.01416.58
7.4.110.0110.00716.64
7.4.100.0180.00016.54
7.4.90.0120.00616.52
7.4.80.0090.01219.39
7.4.70.0110.00816.65
7.4.60.0120.00616.56
7.4.50.0050.00916.33
7.4.40.0090.00916.59
7.4.00.0060.00314.83
7.3.330.0000.00616.25
7.3.320.0020.00213.39
7.3.310.0070.00016.29
7.3.300.0060.00016.33
7.3.290.0000.00716.39
7.3.260.0120.00716.54
7.3.240.0080.00816.59
7.3.230.0150.00316.66
7.3.210.0080.00816.41
7.3.200.0110.00516.38
7.3.190.0130.00316.27
7.3.180.0100.01016.56
7.3.170.0100.00716.57
7.3.160.0070.01016.69
7.3.120.0090.00815.98
7.3.110.0070.00815.52
7.3.100.0060.00715.65
7.3.90.0050.00915.50
7.3.80.0050.01015.62
7.3.70.0080.00615.62
7.3.60.0050.00915.47
7.3.50.0060.00615.56
7.3.40.0040.00715.58
7.3.30.0060.00715.56
7.3.20.0050.00816.22
7.3.10.0030.01016.20
7.3.00.0080.00616.24
7.2.330.0120.00616.76
7.2.320.0150.01016.61
7.2.310.0100.00716.64
7.2.300.0110.01116.88
7.2.290.0100.00616.88
7.2.240.0060.00815.81
7.2.230.0030.01115.63
7.2.220.0050.00815.80
7.2.210.0080.00615.76
7.2.200.0100.00815.74
7.2.190.0020.01315.72
7.2.180.0050.00715.75
7.2.170.0080.00715.77
7.2.160.0070.00915.80
7.2.150.0090.00616.29
7.2.140.0080.00816.39
7.2.130.0060.00616.43
7.2.120.0060.00716.49
7.2.110.0050.00916.43
7.2.100.0060.01016.30
7.2.90.0100.00616.43
7.2.80.0050.01316.36
7.2.70.0080.00616.32
7.2.60.0080.00916.48
7.2.50.0050.01116.47
7.2.40.0040.01116.45
7.2.30.0060.00916.36
7.2.20.0060.00616.36
7.2.10.0070.00616.41
7.2.00.0070.00916.45
7.1.330.0120.00515.64
7.1.320.0060.00915.63
7.1.310.0070.00715.73
7.1.300.0050.01015.63
7.1.290.0070.00715.60
7.1.280.0060.00615.63
7.1.270.0070.00715.59
7.1.260.0060.00815.52
7.1.250.0020.01115.65

preferences:
62.77 ms | 400 KiB | 5 Q