3v4l.org

run code in 300+ PHP versions simultaneously
<?php $find = "city"; $re = '/(' . $find . ')\":\s\"(.*?)\"|\"(\w+)\":\s\"(' . $find . ')/m'; $str = '{ "company": { "id": "123456", "name": "Test Company LLC.", "FEIN": "22-2222222", "address": { "address_line_1": { "street": "1 Street St, Suite 12", "city": "San Francisco", "postalCode": "123456" }, "address_line_2": { "state": "CA", "country": "USA" } }, "phone": "1-800-XXX-XXXX", "fax": "1-800-XXX-XXXX", "email": "admin@abc.com", "URL": "www.abc.com" }, "producer": { "id": "LLXXXX", "name": "Test Name", "phone": "555-555-5555", "mobile": "555-555-5555", "fax": "555-555-5555", "email": "test@abc.com", "producerSubCode": "111", "NIPRId": "123456", "stateProducerId": "12344" } }'; preg_match_all($re, $str, $matches); $result["value-match"] = array_slice(array_column($matches, 0),1,2); $result["key-match"] = array_slice(array_column($matches, 0),3,2); var_dump($result);

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.0130.00618.43
8.3.50.0100.00718.39
8.3.40.0160.00918.80
8.3.30.0040.01118.88
8.3.20.0000.00819.18
8.3.10.0040.00421.90
8.3.00.0000.00819.69
8.2.180.0130.00717.00
8.2.170.0060.00922.96
8.2.160.0110.00419.18
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00419.89
8.2.120.0050.00226.35
8.2.110.0070.01019.21
8.2.100.0060.00618.16
8.2.90.0060.00317.75
8.2.80.0030.00517.97
8.2.70.0000.00818.05
8.2.60.0000.00817.75
8.2.50.0030.00617.88
8.2.40.0030.00519.17
8.2.30.0040.00419.42
8.2.20.0070.00018.11
8.2.10.0000.00718.27
8.2.00.0040.00419.53
8.1.280.0110.00725.92
8.1.270.0070.00023.85
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0030.00619.03
8.1.230.0040.00817.83
8.1.220.0090.00017.74
8.1.210.0030.00518.77
8.1.200.0080.00017.61
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0030.00518.64
8.1.160.0000.00718.80
8.1.150.0050.00218.80
8.1.140.0070.00017.74
8.1.130.0040.00418.96
8.1.120.0070.00017.66
8.1.110.0040.00417.64
8.1.100.0050.00217.60
8.1.90.0040.00417.64
8.1.80.0050.00617.61
8.1.70.0020.00517.64
8.1.60.0070.00417.75
8.1.50.0030.00817.73
8.1.40.0000.00817.68
8.1.30.0030.00517.89
8.1.20.0000.00817.80
8.1.10.0100.00017.78
8.1.00.0040.00417.64
8.0.300.0090.00018.77
8.0.290.0050.00516.60
8.0.280.0000.00818.49
8.0.270.0030.00317.29
8.0.260.0000.00717.25
8.0.250.0000.00717.11
8.0.240.0030.00517.01
8.0.230.0040.00417.01
8.0.220.0040.00417.09
8.0.210.0070.00017.04
8.0.200.0070.00017.13
8.0.190.0000.00817.00
8.0.180.0000.00717.02
8.0.170.0040.00417.04
8.0.160.0000.00717.11
8.0.150.0040.00416.94
8.0.140.0050.00316.98
8.0.130.0030.00313.44
8.0.120.0000.00716.92
8.0.110.0000.00817.00
8.0.100.0000.00717.09
8.0.90.0040.00416.86
8.0.80.0080.00717.01
8.0.70.0030.00517.08
8.0.60.0000.00717.09
8.0.50.0040.00417.05
8.0.30.0120.00617.36
8.0.20.0080.01217.40
8.0.10.0030.00517.18
8.0.00.0120.00716.93
7.4.330.0000.00515.55
7.4.320.0030.00516.73
7.4.300.0040.00416.87
7.4.290.0000.00716.78
7.4.280.0030.00516.79
7.4.270.0050.00316.68
7.4.260.0050.00216.61
7.4.250.0030.00316.77
7.4.240.0040.00416.66
7.4.230.0000.00816.75
7.4.220.0040.00416.61
7.4.210.0090.00616.68
7.4.200.0040.00416.76
7.4.160.0070.01016.66
7.4.140.0120.00717.86
7.4.130.0100.01316.73
7.4.120.0090.00916.79
7.4.110.0100.00816.66
7.4.100.0090.00916.69
7.4.90.0140.00816.77
7.4.80.0100.01719.39
7.4.70.0160.00516.63
7.4.60.0090.00616.84
7.4.50.0120.00316.43
7.4.40.0000.01816.63
7.4.00.0020.01615.26
7.3.330.0000.00513.38
7.3.320.0000.00713.22
7.3.310.0070.00016.58
7.3.300.0040.00216.43
7.3.290.0070.00016.48
7.3.280.0050.01216.48
7.3.260.0130.00516.63
7.3.240.0090.00716.57
7.3.230.0070.01116.64
7.3.210.0130.00516.89
7.3.200.0110.00616.75
7.3.190.0090.00916.77
7.3.180.0090.00616.73
7.3.170.0130.00616.55
7.3.160.0000.01716.48
7.3.120.0060.01115.00
7.3.110.0080.01115.00
7.3.100.0110.00715.04
7.3.90.0130.00314.92
7.3.80.0070.00715.00
7.3.70.0000.01515.07
7.3.60.0110.00614.87
7.3.50.0060.00615.00
7.3.40.0080.00815.11
7.3.30.0070.00314.97
7.3.20.0060.00316.92
7.3.10.0080.00516.84
7.3.00.0050.00516.90
7.2.330.0070.01816.59
7.2.320.0150.00916.69
7.2.310.0090.01216.71
7.2.300.0060.01916.50
7.2.290.0170.01016.55
7.2.250.0110.00715.20
7.2.240.0070.01115.32
7.2.230.0030.01215.21
7.2.220.0080.00415.13
7.2.210.0070.00715.21
7.2.200.0090.01214.99
7.2.190.0070.00714.69
7.2.180.0000.01314.95
7.2.170.0000.01615.13
7.2.130.0060.00816.72
7.2.120.0070.00716.95
7.2.110.0070.00316.78
7.2.100.0040.00416.92
7.2.90.0040.00717.09
7.2.80.0070.00416.98
7.2.70.0100.00316.92
7.2.60.0070.00717.00
7.2.50.0040.00417.07
7.2.40.0090.00817.67
7.2.30.0400.00617.52
7.2.20.0220.01117.63
7.2.10.0510.01117.32
7.2.00.0090.00517.48
7.1.330.0030.01016.04
7.1.320.0080.00415.78
7.1.310.0030.01015.98
7.1.300.0040.01415.77
7.1.290.0000.01215.99
7.1.280.0070.00716.04
7.1.270.0000.01216.12
7.1.260.0080.00416.21
7.1.250.0080.00815.85
7.1.200.0060.00616.04
7.1.160.0170.00917.21
7.1.150.0790.00716.96
7.1.140.0100.01217.09
7.1.130.0070.01217.07
7.1.120.1040.00816.73
7.1.110.1040.00616.41
7.1.100.1140.00616.63
7.1.90.1080.00916.67
7.1.80.0920.00816.35
7.1.70.1110.00715.39
7.1.60.1340.00933.50
7.1.50.1170.00933.18
7.1.40.1120.01532.84
7.1.30.0990.01032.87
7.1.20.1210.01333.18
7.1.10.1050.01214.82
7.1.00.1550.00714.95

preferences:
30.5 ms | 400 KiB | 5 Q