3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$lines = file('your_text_file.txt', FILE_IGNORE_NEW_LINES); $lines = [ '3M Company MMM', '99 Cents Only Stores NDN', 'AO Smith Corporation AOS', 'Aaron\'s, Inc. AAN', ]; foreach ($lines as $line) { [$names[], $symbols[]] = preg_split('~\s+(?=[A-Z]+$)~m', $line); } var_export($names); echo "\n---\n"; var_export($symbols); unset($names, $symbols); echo "\n***\n"; //$text = file_get_contents('your_text_file.txt'); $text = <<<TEXT 3M Company MMM 99 Cents Only Stores NDN AO Smith Corporation AOS Aaron's, Inc. AAN TEXT; preg_match_all('~(.+?)\s+([A-Z]+)$~m', $text, $matches, PREG_SET_ORDER); var_export(array_column($matches, 1)); echo "\n---\n"; var_export(array_column($matches, 2));

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.120.0100.00820.81
8.4.110.0130.00822.57
8.4.100.0140.00720.55
8.4.90.0090.01118.58
8.4.80.0140.00618.93
8.4.70.0040.00418.15
8.4.60.0120.00918.72
8.4.50.0120.00818.57
8.4.40.0100.01019.73
8.4.30.0000.00918.89
8.4.20.0130.00618.91
8.4.10.0060.00319.84
8.3.250.0110.00918.82
8.3.240.0080.01019.05
8.3.230.0120.00816.74
8.3.220.0090.01018.93
8.3.210.0090.00516.61
8.3.200.0070.00216.76
8.3.190.0110.00817.43
8.3.180.0120.00719.08
8.3.170.0030.00616.72
8.3.160.0120.00917.31
8.3.150.0060.01216.88
8.3.140.0120.00320.70
8.3.130.0040.00718.84
8.3.120.0070.00419.02
8.3.110.0040.00420.94
8.3.100.0000.00824.06
8.3.90.0060.00326.77
8.3.80.0060.00317.97
8.3.70.0070.00716.63
8.3.60.0150.00418.55
8.3.50.0120.00618.39
8.3.40.0040.01119.09
8.3.30.0090.00919.09
8.3.20.0030.00624.18
8.3.10.0000.00724.66
8.3.00.0040.00426.16
8.2.290.0090.01020.67
8.2.280.0120.00818.61
8.2.270.0070.01116.80
8.2.260.0140.00416.79
8.2.250.0040.00418.45
8.2.240.0030.00617.17
8.2.230.0070.00722.58
8.2.220.0070.01037.54
8.2.210.0140.00026.77
8.2.200.0090.00016.75
8.2.190.0140.00718.54
8.2.180.0000.01525.92
8.2.170.0160.00319.12
8.2.160.0100.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.25
8.2.110.0030.00821.12
8.2.100.0090.00318.03
8.2.90.0000.00819.34
8.2.80.0030.00517.97
8.2.70.0080.00017.75
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0030.00518.29
8.2.30.0040.00418.19
8.2.20.0000.00818.03
8.2.10.0060.00321.14
8.2.00.0040.00419.13
8.1.330.0050.00522.11
8.1.320.0120.00816.22
8.1.310.0120.00616.33
8.1.300.0000.00916.16
8.1.290.0100.00030.84
8.1.280.0120.00325.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00422.46
8.1.230.0080.00320.88
8.1.220.0050.00317.77
8.1.210.0000.00818.96
8.1.200.0030.00717.48
8.1.190.0040.00417.34
8.1.180.0040.00418.10
8.1.170.0040.00418.91
8.1.160.0040.00418.96
8.1.150.0080.00018.93
8.1.140.0050.00318.95
8.1.130.0040.00420.18
8.1.120.0000.00717.60
8.1.110.0030.00517.59
8.1.100.0000.00717.50
8.1.90.0050.00317.58
8.1.80.0000.00817.50
8.1.70.0040.00417.66
8.1.60.0080.00017.70
8.1.50.0080.00017.68
8.1.40.0030.00617.66
8.1.30.0030.00617.77
8.1.20.0050.00317.80
8.1.10.0040.00417.68
8.1.00.0030.00517.64
8.0.300.0080.00020.03
8.0.290.0040.00416.88
8.0.280.0070.00018.38
8.0.270.0050.00318.15
8.0.260.0000.00718.40
8.0.250.0000.00717.21
8.0.240.0000.00717.14
8.0.230.0030.00317.09
8.0.220.0000.00817.15
8.0.210.0000.00717.06
8.0.200.0000.00717.03
8.0.190.0030.00617.18
8.0.180.0040.00417.01
8.0.170.0000.00816.99
8.0.160.0040.00416.98
8.0.150.0040.00417.05
8.0.140.0060.00317.11
8.0.130.0060.00013.59
8.0.120.0040.00416.97
8.0.110.0030.00516.92
8.0.100.0000.00716.92
8.0.90.0050.00217.15
8.0.80.0080.00917.07
8.0.70.0070.00017.05
8.0.60.0030.00517.05
8.0.50.0050.00317.17
8.0.30.0060.01317.12
8.0.20.0060.01217.11
8.0.10.0130.00917.20
8.0.00.0060.01317.18
7.4.330.0000.00615.55
7.4.320.0030.00316.71
7.4.300.0070.00416.82
7.4.290.0040.00416.76
7.4.280.0050.00216.80
7.4.270.0040.00416.85
7.4.260.0060.00013.48
7.4.250.0070.00016.67
7.4.240.0030.00316.73
7.4.230.0040.00416.85
7.4.220.0030.00316.63
7.4.210.0080.00716.79
7.4.200.0070.00016.72
7.4.160.0040.01016.76
7.4.150.0120.00416.75
7.4.140.0060.01216.79
7.4.130.0120.00816.76
7.4.120.0140.00516.64
7.4.110.0110.00716.78
7.4.100.0200.00316.79
7.4.90.0160.00816.72
7.4.80.0120.01216.63
7.4.70.0210.00316.74
7.4.60.0140.00716.59
7.4.50.0200.00716.65
7.4.40.0190.00316.64
7.4.30.0170.00816.77
7.4.20.0160.00316.61
7.4.10.0180.00316.73
7.4.00.0090.01116.79
7.3.330.0030.00516.59
7.3.320.0000.00613.38
7.3.310.0030.00316.50
7.3.300.0030.00316.53
7.3.290.0100.00516.58
7.3.270.0130.00416.56
7.3.260.0120.00816.48
7.3.250.0110.00816.50
7.3.240.0060.01916.48
7.3.230.0150.01116.55
7.3.220.0190.00416.51
7.3.210.0040.01316.46
7.3.200.0130.00916.45
7.3.190.0120.01516.46
7.3.180.0120.01216.50
7.3.170.0140.00916.51
7.3.160.0130.01116.46
7.3.150.0040.01916.43
7.3.140.0170.00816.45
7.3.130.0170.01016.46
7.3.120.0120.00916.41
7.3.110.0170.00316.32
7.3.100.0190.00316.46
7.3.90.0080.01616.77
7.3.80.0080.01416.53
7.3.70.0110.01116.47
7.3.60.0160.01116.61
7.3.50.0110.01416.61
7.3.40.0150.00516.53
7.3.30.0220.00416.57
7.3.20.0160.00816.59
7.3.10.0100.01716.46
7.3.00.0160.01116.51

preferences:
115.47 ms | 403 KiB | 5 Q