3v4l.org

run code in 300+ PHP versions simultaneously
<?php function genRand($length = 10, $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') { $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $chars[rand(0, strlen($chars) - 1)]; } return $randomString; } function populate($count = 10000) { $array = array(); for($i = 0; $i < $count; $i++) { $phone = genRand(5,'0123456789'); $array[$phone] = array( 'phone' => $phone, 'name' => genRand(20), 'age' => genRand(2, '0123456789'), ); } return $array; } $array1 = populate(40000); $array2 = populate(40000); $match = FALSE; foreach($array1 as $key => $value) { if(array_key_exists($key, $array2)) { $match = TRUE; break; } } print_r(($match ? 'matched' : 'nope'));

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)
7.3.10.0330.24052.39
7.3.00.0170.21952.68
7.2.130.0230.24152.69
7.2.120.0230.23653.04
7.2.110.0350.26252.95
7.2.100.0270.24152.65
7.2.90.0330.24552.72
7.2.80.0200.25553.09
7.2.70.0300.25052.80
7.2.60.0270.24452.98
7.2.50.0140.23752.76
7.2.40.0260.23252.91
7.2.30.0330.27352.87
7.2.20.0350.27852.98
7.2.10.0360.23752.53
7.2.00.0300.24052.88
7.1.250.0130.57851.71
7.1.70.0800.38053.11
7.1.60.0070.35853.02
7.1.50.0140.33870.98
7.1.00.0070.37358.35
7.0.200.0030.30252.89
7.0.140.0170.36758.00
7.0.60.0130.36054.19
7.0.50.0130.30752.05
7.0.40.0130.35322.39
7.0.30.0530.33722.04
7.0.20.0270.38022.39
7.0.10.0170.30022.09
7.0.00.0200.37722.20
5.6.210.0330.73373.86
5.6.200.0200.73771.08
5.6.190.0200.74773.66
5.6.180.0330.67373.57
5.6.170.0700.69773.40
5.6.160.0230.75373.30
5.6.150.0230.65371.17
5.6.140.0230.72071.27
5.6.130.0130.74371.15
5.6.120.0300.73074.17
5.6.110.0230.71774.09
5.6.100.0230.73374.02
5.6.90.0170.73374.01
5.6.80.0170.80773.52
5.6.70.4770.62373.48
5.5.350.0200.78073.71
5.5.340.0200.78071.46
5.5.330.0170.71773.84
5.5.320.0730.69373.54
5.5.310.0370.78073.81
5.5.300.0200.78071.34
5.5.290.0200.74071.59
5.5.280.0270.72074.54
5.5.270.0130.71774.16
5.5.260.0070.79074.27
5.5.250.0170.80073.88
5.5.240.0270.75773.65
5.4.450.0800.73072.88
5.4.440.4400.69772.57
5.4.430.1930.75072.67
5.4.420.0500.67772.64
5.4.410.0330.75072.80
5.4.400.0370.74772.36
5.4.390.2430.70372.59
5.4.380.0430.76372.65
5.4.370.0400.74772.22
5.4.360.0430.67772.41
5.4.350.0430.74372.36
5.4.340.0500.76072.70
5.4.320.0330.79072.47
5.4.310.0500.74072.46
5.4.300.0280.89165.81
5.4.290.0270.94266.00
5.4.280.0360.94365.75
5.4.270.0340.90865.92
5.4.260.0340.99165.65
5.4.250.0330.90965.88
5.4.240.0420.95865.84
5.4.230.0240.92365.86
5.4.220.0231.00765.86
5.4.210.0200.77072.36
5.4.200.0330.77072.43
5.4.190.0700.69072.77
5.4.180.0700.70072.60
5.4.170.0230.77772.57
5.4.160.0570.79772.45
5.4.150.3830.69072.46
5.4.140.3170.69369.84
5.4.130.0400.69369.64
5.4.120.0400.76369.67
5.4.110.0200.78069.64
5.4.100.0270.69769.64
5.4.90.0330.70369.65
5.4.80.0030.69369.94
5.4.70.1130.68069.77
5.4.60.0030.77070.02
5.4.50.0100.78369.89
5.4.40.0130.78769.63
5.4.30.0270.74370.03
5.4.20.0470.74369.73
5.4.10.3570.67070.05
5.4.00.5070.67769.36
5.3.290.3530.80768.52
5.3.280.3670.83068.41
5.3.270.4400.81368.39
5.3.260.4370.79768.46
5.3.250.2270.81768.54
5.3.240.0470.86768.54
5.3.230.0400.85769.11
5.3.220.3330.86368.35
5.3.210.0600.85768.41
5.3.200.0300.82368.48
5.3.190.1400.80368.52
5.3.180.0470.88068.48
5.3.170.0100.94768.47
5.3.160.0370.83768.52
5.3.150.0571.13368.34
5.3.140.0500.88768.64
5.3.130.0600.88068.49
5.3.120.0870.84368.55
5.3.110.0330.81368.38
5.3.100.3230.84768.24
5.3.90.0570.91767.91
5.3.80.0600.91767.91
5.3.70.0330.86767.89

preferences:
31.62 ms | 400 KiB | 5 Q