3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ad = "123 Main Street St. Louisville OH 43071,432 Main Long Road St. Louisville OH 43071,786 High Street Pollocksville NY 56432," ."54 Holy Grail Street Niagara Town ZP 32908,3200 Main Rd. Bern AE 56210,1 Gordon St. Atlanta RE 13000," ."10 Pussy Cat Rd. Chicago EX 34342,10 Gordon St. Atlanta RE 13000,58 Gordon Road Atlanta RE 13000," ."22 Tokyo Av. Tedmondville SW 43098,674 Paris bd. Abbeville AA 45521,10 Surta Alley Goodtown GG 30654," ."45 Holy Grail Al. Niagara Town ZP 32908,320 Main Al. Bern AE 56210,14 Gordon Park Atlanta RE 13000," ."100 Pussy Cat Rd. Chicago EX 34342,2 Gordon St. Atlanta RE 13000,5 Gordon Road Atlanta RE 13000," ."2200 Tokyo Av. Tedmondville SW 43098,67 Paris St. Abbeville AA 45521,11 Surta Avenue Goodtown GG 30654," ."45 Holy Grail Al. Niagara Town ZP 32918,320 Main Al. Bern AE 56215,14 Gordon Park Atlanta RE 13200," ."100 Pussy Cat Rd. Chicago EX 34345,2 Gordon St. Atlanta RE 13222,5 Gordon Road Atlanta RE 13001," ."2200 Tokyo Av. Tedmondville SW 43198,67 Paris St. Abbeville AA 45522,11 Surta Avenue Goodville GG 30655," ."2222 Tokyo Av. Tedmondville SW 43198,670 Paris St. Abbeville AA 45522,114 Surta Avenue Goodville GG 30655," ."2 Holy Grail Street Niagara Town ZP 32908,3 Main Rd. Bern AE 56210,77 Gordon St. Atlanta RE 13000"; function travel($r, $zipcode) { $fullAddress = explode( "," , $r ); $filteredAddress = preg_grep("/".$zipcode."$/" , $fullAddress); $splitAddress = array_reduce( $filteredAddress , function($total, $current) { preg_match_all( "/^[0-9]+ |.*(?=[A-Z]{2} [0-9]{5}$)/" , $current , $matches ); array_push($total['streetNames'], trim($matches[0][1])); array_push($total['streetNos'], trim($matches[0][0])); return $total; } , array("streetNames"=>[],"streetNos"=>[])); return $zipcode .":" .implode(',' , $splitAddress["streetNames"]) ."/" .implode(',' , $splitAddress["streetNos"]); } echo(travel($ad, "NY 5643"));

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.45
8.3.50.0120.00316.61
8.3.40.0110.01419.01
8.3.30.0070.01119.02
8.3.20.0040.00421.77
8.3.10.0000.01123.37
8.3.00.0030.00519.79
8.2.180.0080.00818.66
8.2.170.0080.00822.96
8.2.160.0110.00721.37
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0040.00420.47
8.2.120.0040.00426.35
8.2.110.0000.00922.31
8.2.100.0090.00317.97
8.2.90.0000.00819.22
8.2.80.0030.00517.97
8.2.70.0080.00018.00
8.2.60.0030.00518.05
8.2.50.0030.00518.10
8.2.40.0040.00422.41
8.2.30.0060.00319.40
8.2.20.0030.00618.21
8.2.10.0000.00818.25
8.2.00.0040.00418.30
8.1.280.0100.00625.92
8.1.270.0080.00023.96
8.1.260.0020.00526.35
8.1.250.0000.00728.09
8.1.240.0060.00321.14
8.1.230.0080.00419.41
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0030.00617.60
8.1.190.0000.00817.48
8.1.180.0060.00318.10
8.1.170.0000.00918.75
8.1.160.0050.00218.96
8.1.150.0040.00418.95
8.1.140.0040.00419.65
8.1.130.0040.00420.65
8.1.120.0070.00017.60
8.1.110.0000.00717.73
8.1.100.0050.00217.63
8.1.90.0040.00417.70
8.1.80.0000.00717.64
8.1.70.0000.00717.54
8.1.60.0040.00417.67
8.1.50.0080.00017.75
8.1.40.0000.00817.69
8.1.30.0040.00417.88
8.1.20.0060.00317.83
8.1.10.0050.00317.63
8.1.00.0000.00817.68
8.0.300.0070.00018.77
8.0.290.0040.00417.00
8.0.280.0070.00018.52
8.0.270.0070.00017.26
8.0.260.0000.00717.05
8.0.250.0060.00317.05
8.0.240.0000.00717.18
8.0.230.0070.00017.04
8.0.220.0000.00717.05
8.0.210.0000.00717.09
8.0.200.0030.00316.99
8.0.190.0040.00417.02
8.0.180.0000.00717.11
8.0.170.0040.00417.18
8.0.160.0050.00317.07
8.0.150.0040.00417.02
8.0.140.0030.00517.12
8.0.130.0000.00613.49
8.0.120.0040.00417.02
8.0.110.0040.00417.13
8.0.100.0040.00416.97
8.0.90.0000.00717.04
8.0.80.0000.01817.05
8.0.70.0000.00716.96
8.0.60.0000.00716.88
8.0.50.0030.00517.07
8.0.30.0090.00717.32
8.0.20.0090.01117.46
8.0.10.0040.00417.21
8.0.00.0110.00816.92
7.4.330.0060.00015.55
7.4.320.0000.00716.77
7.4.300.0060.00016.89
7.4.290.0030.00616.68
7.4.280.0000.00816.84
7.4.270.0070.00016.87
7.4.260.0000.00716.69
7.4.250.0040.00416.73
7.4.240.0030.00516.72
7.4.230.0000.00716.89
7.4.220.0130.00516.79
7.4.210.0150.00316.94
7.4.200.0040.00416.62
7.4.160.0070.01216.70
7.4.150.0110.00717.40
7.4.140.0090.00817.86
7.4.130.0090.00916.95
7.4.120.0100.01016.84
7.4.110.0100.00616.80
7.4.100.0130.00416.90
7.4.90.0060.00916.66
7.4.80.0120.01219.39
7.4.70.0140.00616.61
7.4.60.0100.00716.57
7.4.50.0110.00416.80
7.4.40.0130.01016.75
7.4.30.0120.01016.95
7.4.00.0030.00715.19
7.3.330.0080.00013.55
7.3.320.0030.00313.52
7.3.310.0070.00016.59
7.3.300.0040.00416.58
7.3.290.0070.00916.46
7.3.280.0090.01016.49
7.3.270.0030.01317.40
7.3.260.0060.01216.61
7.3.250.0100.01016.67
7.3.240.0150.00316.76
7.3.230.0140.00316.70
7.3.210.0090.00916.64
7.3.200.0120.00316.55
7.3.190.0060.01116.73
7.3.180.0080.00816.66
7.3.170.0030.01416.70
7.3.160.0090.00616.57
7.2.330.0090.01216.95
7.2.320.0170.00316.91
7.2.310.0030.01316.82
7.2.300.0070.01016.70
7.2.290.0050.01916.70
7.2.60.0070.01016.76
7.2.50.0070.00716.89
7.1.200.0040.00815.97
7.1.70.0100.00317.05
7.1.60.2130.01333.36
7.1.50.1670.01032.93
7.1.40.1700.01732.18
7.1.30.2300.02332.41
7.1.20.1500.01032.55
7.1.10.1330.01014.95
7.1.00.3000.01715.21
7.0.200.2130.00715.23
7.0.190.2100.01014.89
7.0.180.1800.02014.59
7.0.170.3830.01014.47
7.0.160.2230.01314.62
7.0.150.1270.01314.55
7.0.140.1870.02014.64
7.0.130.2000.01014.89
7.0.120.1800.00315.01
7.0.110.1730.01014.66
7.0.100.2400.01314.76
7.0.90.2430.01314.77
7.0.80.2470.00714.51
7.0.70.2230.01014.43
7.0.60.2730.01714.73
7.0.50.1700.00714.78
7.0.40.2600.01014.77
7.0.30.1900.01315.08
7.0.20.1800.00715.02
7.0.10.1700.00714.99
7.0.00.1570.01014.93

preferences:
50.76 ms | 400 KiB | 5 Q