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(10,'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(!empty($array2[$key])) { $match = TRUE; break 2; } } 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)
5.6.280.0200.88785.54
5.6.190.0170.77085.03
5.6.180.0430.83784.95
5.6.170.0470.86784.92
5.6.160.0270.75384.78
5.6.150.0370.73782.71
5.6.140.0430.82082.84
5.6.130.0130.83082.75
5.6.120.0270.76085.75
5.6.110.0400.84085.65
5.6.100.0200.82785.59
5.6.90.0330.81785.71
5.6.70.4200.75385.00
5.5.350.0330.88085.10
5.5.340.0170.83382.54
5.5.330.0130.81784.75
5.5.320.0400.82384.84
5.5.310.2200.82384.82
5.5.300.0471.04082.55
5.5.290.0270.89082.64
5.5.280.0130.84785.41
5.5.270.0300.87785.48
5.5.250.0230.80085.07
5.5.240.0370.91384.86
5.4.450.0430.75783.73
5.4.440.3770.76083.96
5.4.430.0370.76784.13
5.4.420.0400.74783.96
5.4.410.0370.80083.81
5.4.390.2270.76083.71
5.4.380.0470.78083.64
5.4.370.0300.89783.75
5.4.360.0630.84783.55
5.4.350.1730.85083.62
5.4.320.0470.85383.64
5.4.310.0800.82383.64
5.4.300.0361.01277.11
5.4.290.0401.07077.10
5.4.280.0361.00776.99
5.4.270.0341.05677.00
5.4.260.0431.08277.00
5.4.250.0350.96877.00
5.4.240.0381.01477.01
5.4.230.0311.02877.02
5.4.220.0421.03976.99
5.4.210.0481.23677.00
5.4.200.0441.16577.00
5.4.190.0521.21177.00
5.4.180.0441.29376.99
5.4.170.0401.21577.00
5.4.160.0361.09276.98
5.4.150.0350.98977.02
5.4.140.0401.26976.68
5.4.130.0430.93576.66
5.4.120.0331.11676.63
5.4.110.0370.97076.61
5.4.100.0371.10676.62
5.4.90.0421.09976.62
5.4.80.0521.32176.63
5.4.70.0411.09676.61
5.4.60.0341.04276.62
5.4.50.0351.15276.62
5.4.40.0301.02976.58
5.4.30.0321.16376.58
5.4.20.0571.47876.58
5.4.10.0581.69376.59
5.4.00.0511.08376.08
5.3.280.0551.46576.05
5.3.270.0421.19076.05
5.3.260.0441.13576.05
5.3.250.0451.10776.06
5.3.240.0461.08576.05
5.3.230.0481.12676.05
5.3.220.0321.12376.02
5.3.210.0401.13176.02
5.3.200.0311.09676.02
5.3.190.0481.31176.02
5.3.180.0331.10576.02
5.3.170.0511.24076.02
5.3.160.0521.11076.02
5.3.150.0371.24276.01
5.3.140.0351.17976.00
5.3.130.0501.14576.00
5.3.120.0781.34176.00
5.3.110.0471.52276.00
5.3.100.0561.18275.49
5.3.90.0451.24175.47
5.3.80.0431.59675.46
5.3.70.0321.21075.46

preferences:
141.61 ms | 1394 KiB | 7 Q