3v4l.org

run code in 300+ PHP versions simultaneously
<?php funtion sales_search($arr, $needle) { foreach ($arr as $id => $data) { if (in_array($needle, $data['states'])) { return $id; } if (in_array($needle, $data['codes'])) { return $id; } } return false; } $sales_people = array( '2' => array( 'states' => array('NY', 'NJ', 'CT', 'MA', 'VT', 'ME'), 'codes' => array('CA1', 'US7', 'UT9') ), '5' => array( 'states' => array('FL', 'GA', 'SC', 'NC', 'TN'), 'codes' => array('VA4', 'VA8', 'VA3') ) ); var_dump(sales_search($sales_people, 'VA4'));

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.4.190.0330.03719.07
5.4.180.0370.06719.21
5.4.170.0470.04319.21
5.4.160.0370.06319.20
5.4.150.0470.05719.29
5.4.140.0330.05716.46
5.4.130.0570.02716.31
5.4.120.0470.03716.45
5.4.110.0270.04016.18
5.4.100.0400.07016.39
5.4.90.0400.04016.41
5.4.80.0400.04316.46
5.4.70.0330.04716.50
5.4.60.0330.04016.53
5.4.50.0330.06716.51
5.4.40.0430.05016.16
5.4.30.0330.03716.37
5.4.20.0300.06016.52
5.4.10.0270.04016.42
5.4.00.0300.03315.74
5.3.270.0430.06714.48
5.3.260.0400.05314.70
5.3.250.0430.06314.65
5.3.240.0370.03014.45
5.3.230.0430.04314.47
5.3.220.0430.05714.50
5.3.210.0300.04314.43
5.3.200.0330.07714.61
5.3.190.0430.06714.43
5.3.180.0400.03314.54
5.3.170.0300.04314.43
5.3.160.0370.04314.51
5.3.150.0330.07314.55
5.3.140.0400.07014.41
5.3.130.0400.07014.48
5.3.120.0500.04014.59
5.3.110.0430.06714.50
5.3.100.0300.04013.88
5.3.90.0370.07013.90
5.3.80.0330.04313.86
5.3.70.0330.04714.11
5.3.60.0400.06313.78
5.3.50.0330.03713.98
5.3.40.0500.05013.89
5.3.30.0370.06313.74
5.3.20.0370.06313.52
5.3.10.0230.04713.63
5.3.00.0300.06313.47

preferences:
137.01 ms | 1398 KiB | 7 Q