3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<EOT { "results" : [ { "address_components" : [ { "long_name" : "Winnetka", "short_name" : "Winnetka", "types" : [ "locality", "political" ] }, { "long_name" : "New Trier", "short_name" : "New Trier", "types" : [ "administrative_area_level_3", "political" ] }, { "long_name" : "Cook County", "short_name" : "Cook County", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "Illinois", "short_name" : "IL", "types" : [ "administrative_area_level_1", "political"] }, { "long_name" : "Switzerland", "short_name" : "CH", "types" : [ "country", "political" ] }, { "long_name" : "United States", "short_name" : "US", "types" : [ "country", "political" ] } ], "formatted_address" : "Winnetka, IL, USA", "geometry" : { "bounds" : { "northeast" : { "lat" : 42.1282269, "lng" : -87.7108162 }, "southwest" : { "lat" : 42.0886089, "lng" : -87.7708629 } }, "location" : { "lat" : 42.10808340000001, "lng" : -87.735895 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 42.1282269, "lng" : -87.7108162 }, "southwest" : { "lat" : 42.0886089, "lng" : -87.7708629 } } }, "place_id" : "ChIJW8Va5TnED4gRY91Ng47qy3Q", "types" : [ "locality", "political" ] }, { "address_components" : [ { "long_name" : "Winnetka", "short_name" : "Winnetka", "types" : [ "locality", "political" ] }, { "long_name" : "New Trier", "short_name" : "New Trier", "types" : [ "administrative_area_level_3", "political" ] }, { "long_name" : "Cook County", "short_name" : "Cook County", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "Illinois", "short_name" : "IL", "types" : [ "administrative_area_level_1", "political"] }, { "long_name" : "United States - 2", "short_name" : "US", "types" : [ "country", "political" ] } ], "formatted_address" : "Winnetka, IL, USA", "geometry" : { "bounds" : { "northeast" : { "lat" : 42.1282269, "lng" : -87.7108162 }, "southwest" : { "lat" : 42.0886089, "lng" : -87.7708629 } }, "location" : { "lat" : 42.10808340000001, "lng" : -87.735895 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 42.1282269, "lng" : -87.7108162 }, "southwest" : { "lat" : 42.0886089, "lng" : -87.7708629 } } }, "place_id" : "ChIJW8Va5TnED4gRY91Ng47qy3Q", "types" : [ "locality", "political" ] } ], "status" : "OK" } EOT; $data = json_decode($json); $counties = []; if(!empty($data->results)){ $counties = array_filter($data->results[0]->address_components, function ($address) { return in_array('administrative_area_level_2', $address->types); }); } if(!empty($counties)){ echo reset($counties)->long_name; }else{ echo 'No county found'; }

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.4.130.0090.01117.60
8.4.120.0120.00820.78
8.4.110.0120.00918.76
8.4.100.0160.00417.59
8.4.90.0120.01018.37
8.4.80.0060.00519.45
8.4.70.0100.00817.83
8.4.60.0090.01118.60
8.4.50.0120.01017.59
8.4.40.0100.01020.52
8.4.30.0030.00717.83
8.4.20.0090.01220.51
8.4.10.0000.00918.81
8.3.260.0080.01116.68
8.3.250.0110.00719.05
8.3.240.0140.00516.63
8.3.230.0110.00816.66
8.3.220.0090.00917.36
8.3.210.0110.00918.36
8.3.200.0050.00416.45
8.3.190.0090.01016.66
8.3.180.0130.00716.71
8.3.170.0060.00316.66
8.3.160.0040.01518.49
8.3.150.0000.01918.98
8.3.140.0030.00516.70
8.3.130.0090.00616.59
8.3.120.0060.00320.92
8.3.110.0090.00016.79
8.3.100.0160.00316.41
8.3.90.0090.00926.77
8.3.80.0000.00916.38
8.3.70.0130.00716.63
8.3.60.0120.00318.16
8.3.50.0110.01018.15
8.3.40.0140.00418.61
8.3.30.0090.00918.71
8.3.20.0070.00023.64
8.3.10.0000.00723.48
8.3.00.0020.00521.91
8.2.290.0120.00820.34
8.2.280.0090.01118.16
8.2.270.0000.01916.47
8.2.260.0120.00617.21
8.2.250.0120.00616.58
8.2.240.0030.00619.00
8.2.230.0040.00420.94
8.2.220.0030.00624.06
8.2.210.0050.00326.77
8.2.200.0060.00318.42
8.2.190.0090.00616.88
8.2.180.0040.01125.92
8.2.170.0090.00618.91
8.2.160.0110.00319.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00317.91
8.2.120.0000.00826.35
8.2.110.0040.00721.08
8.2.100.0000.01217.84
8.2.90.0040.00419.25
8.2.80.0000.00818.05
8.2.70.0030.00517.75
8.2.60.0000.00817.75
8.2.50.0030.00517.63
8.2.40.0000.00818.16
8.2.30.0040.00419.32
8.2.20.0040.00418.05
8.2.10.0040.00418.13
8.2.00.0030.00519.42
8.1.330.0110.00722.06
8.1.320.0140.00816.25
8.1.310.0120.00616.64
8.1.300.0120.00318.15
8.1.290.0060.00330.84
8.1.280.0110.00425.92
8.1.270.0030.00723.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00721.33
8.1.230.0060.00617.95
8.1.220.0050.00517.76
8.1.210.0040.00418.77
8.1.200.0040.00417.22
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0000.00717.62
8.1.160.0000.00718.82
8.1.150.0040.00418.87
8.1.140.0000.00722.07
8.1.130.0060.00320.02
8.1.120.0040.00717.48
8.1.110.0070.00017.32
8.1.100.0050.00217.48
8.1.90.0000.00717.40
8.1.80.0050.00217.48
8.1.70.0000.00717.44
8.1.60.0040.00417.50
8.1.50.0000.00817.44
8.1.40.0040.00417.57
8.1.30.0040.00417.73
8.1.20.0060.00317.66
8.1.10.0030.00517.49
8.1.00.0060.00317.49
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0030.00318.36
8.0.270.0030.00317.18
8.0.260.0070.00020.26
8.0.250.0000.00816.99
8.0.240.0040.00417.04
8.0.230.0000.00716.89
8.0.220.0030.00316.99
8.0.210.0050.00316.89
8.0.200.0000.00617.03
8.0.190.0000.01016.89
8.0.180.0050.00316.85
8.0.170.0080.00016.81
8.0.160.0030.00617.08
8.0.150.0000.00716.95
8.0.140.0040.00416.93
8.0.130.0000.00513.40
8.0.120.0000.00716.95
8.0.110.0040.00416.94
8.0.100.0050.00316.91
8.0.90.0000.00716.78
8.0.80.0120.00416.94
8.0.70.0040.00416.85
8.0.60.0000.00716.96
8.0.50.0040.00416.91
8.0.30.0140.00717.16
8.0.20.0120.00617.40
8.0.10.0000.00716.95
8.0.00.0090.00916.66
7.4.330.0000.00516.69
7.4.320.0030.00316.52
7.4.300.0000.00716.63
7.4.290.0030.00316.63
7.4.280.0000.00816.61
7.4.270.0000.00716.60
7.4.260.0050.00316.59
7.4.250.0000.00716.50
7.4.240.0030.00516.42
7.4.230.0000.00716.72
7.4.220.0050.00316.35
7.4.210.0060.01116.60
7.4.200.0040.00416.69
7.4.160.0080.01016.43
7.4.140.0100.01017.86
7.4.130.0090.00916.62
7.4.120.0090.01516.49
7.4.110.0120.00616.71
7.4.100.0220.04416.52
7.4.90.0110.00616.45
7.4.80.0110.01119.39
7.4.70.0120.00616.57
7.4.60.0070.01016.57
7.4.50.0030.00616.46
7.4.40.0070.01416.40
7.4.00.0100.00414.95
7.3.330.0000.00513.36
7.3.320.0000.00613.23
7.3.310.0050.00316.40
7.3.300.0070.00016.37
7.3.290.0030.00316.24
7.3.280.0070.00816.34
7.3.260.0110.00916.48
7.3.240.0090.01116.37
7.3.230.0100.00716.40
7.3.210.0070.01016.38
7.3.200.0090.00616.47
7.3.190.0090.00916.44
7.3.180.0140.00316.37
7.3.170.0100.00716.47
7.3.160.0130.00316.36
7.2.330.0070.01716.59
7.2.320.0090.00816.49
7.2.310.0170.00016.52
7.2.300.0100.01316.82
7.2.290.0030.01816.54
7.2.120.0720.01314.31
7.2.110.0640.00714.51
7.2.100.2600.00714.95
7.2.90.0980.00714.39
7.2.80.1140.00314.57
7.2.70.0810.00314.90
7.2.60.0790.00714.77
7.2.50.1230.01015.17
7.2.40.2090.00915.17
7.2.30.1700.00314.97
7.2.20.1790.00714.88
7.2.10.1130.01314.85
7.2.00.1510.01014.77
5.6.380.0080.00814.21

preferences:
28.78 ms | 403 KiB | 5 Q