3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address = '5e Dorpsstraat 5-B'; $matchArr = array(); $matchesFound = preg_match_all('/(\d+)/', $address, $matchArr); if ($matchesFound === 0) { throw new TransactionValidationException('Could not find house number in address.'); } $houseNumber = array_pop($matchArr[0]); // strrpos om problemen te voorkomen bij straatnamen zoals 151th Avenue 151 $houseNumberStartPos = strrpos($address, $houseNumber); $streetName = substr($address, 0, $houseNumberStartPos); // Verwijder whitespace bij correcte notatie, geen -1 op strrpos voor foute notatie. // Voorbeeld Dorpsstraat 12 (correct), Dorpsstraat12 (incorrect). $streetName = trim($streetName); $houseNumberAdd = NULL; // Check of er mogelijk een additie is op het huisnummer, zoals B of -A of w/e. if (strlen($address) > ($houseNumberStartPos + strlen($houseNumber))) { $houseNumberAdd = substr($address, ($houseNumberStartPos + strlen($houseNumber))); $matchArr = array(); // Filter alles dat niet alfa is uit de addition field. $matchFound = preg_match('/a-Z/', $houseNumberAdd, $matchArr); if ($matchFound === 1) { $houseNumberAdd = $matchArr[0]; } } print $streetName . " / "; print $houseNumber . " / "; print $houseNumberAdd;

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.0110.00716.50
8.3.50.0120.00922.08
8.3.40.0100.00718.97
8.3.30.0070.00719.04
8.3.20.0000.00720.36
8.3.10.0040.00423.66
8.3.00.0000.00819.14
8.2.180.0100.00717.00
8.2.170.0110.00422.96
8.2.160.0040.01120.30
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00420.80
8.2.110.0060.00322.38
8.2.100.0040.00722.26
8.2.90.0030.00619.21
8.2.80.0040.00418.00
8.2.70.0000.00917.75
8.2.60.0050.00318.04
8.2.50.0000.00818.07
8.2.40.0050.00320.07
8.2.30.0040.00418.34
8.2.20.0040.00417.98
8.2.10.0000.00718.13
8.2.00.0040.00417.87
8.1.280.0090.00625.92
8.1.270.0040.00423.85
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0000.01021.93
8.1.230.0070.00419.04
8.1.220.0000.00917.79
8.1.210.0040.00418.77
8.1.200.0030.00617.50
8.1.190.0000.00817.38
8.1.180.0040.00418.10
8.1.170.0030.00618.51
8.1.160.0040.00422.04
8.1.150.0000.00718.67
8.1.140.0020.00517.45
8.1.130.0030.00317.44
8.1.120.0060.00317.57
8.1.110.0000.00817.59
8.1.100.0000.00717.57
8.1.90.0000.00717.52
8.1.80.0040.00417.59
8.1.70.0000.00817.46
8.1.60.0000.00817.59
8.1.50.0040.00417.63
8.1.40.0030.00517.59
8.1.30.0000.00917.63
8.1.20.0040.00417.74
8.1.10.0000.00817.64
8.1.00.0000.00717.64
8.0.300.0080.00018.77
8.0.290.0090.00016.75
8.0.280.0030.00318.51
8.0.270.0070.00017.20
8.0.260.0030.00516.97
8.0.250.0030.00317.01
8.0.240.0030.00317.14
8.0.230.0030.00316.99
8.0.220.0000.00717.04
8.0.210.0030.00316.90
8.0.200.0030.00316.98
8.0.190.0070.00016.98
8.0.180.0030.00517.06
8.0.170.0050.00217.06
8.0.160.0060.00316.88
8.0.150.0050.00316.99
8.0.140.0030.00516.98
8.0.130.0060.00013.43
8.0.120.0030.00616.94
8.0.110.0050.00317.00
8.0.100.0040.00417.07
8.0.90.0000.00716.91
8.0.80.0060.00917.01
8.0.70.0000.00717.07
8.0.60.0000.00717.02
8.0.50.0000.00716.93
8.0.30.0090.00917.12
8.0.20.0090.01017.40
8.0.10.0040.00416.96
8.0.00.0130.00816.87
7.4.330.0030.00315.00
7.4.320.0000.00716.70
7.4.300.0000.00716.70
7.4.290.0070.00016.73
7.4.280.0040.00416.78
7.4.270.0040.00416.76
7.4.260.0030.00316.78
7.4.250.0000.00716.62
7.4.240.0000.00716.72
7.4.230.0000.00716.72
7.4.220.0100.01616.83
7.4.210.0060.01316.77
7.4.200.0070.00016.52
7.4.190.0000.00716.96
7.4.160.0070.01016.87
7.4.150.0060.01217.40
7.4.140.0120.01417.86
7.4.130.0120.00816.70
7.4.120.0060.01016.88
7.4.110.0100.00716.80
7.4.100.0080.00816.71
7.4.90.0030.01316.80
7.4.80.0070.01419.39
7.4.70.0060.01316.69
7.4.60.0030.01416.73
7.4.50.0000.00916.84
7.4.40.0150.00416.51
7.4.30.0130.00316.82
7.4.00.0100.00814.95
7.3.330.0000.00613.30
7.3.320.0000.00513.15
7.3.310.0000.00816.52
7.3.300.0000.00816.47
7.3.290.0080.00716.50
7.3.280.0080.00916.52
7.3.270.0030.01317.40
7.3.260.0080.00916.77
7.3.250.0100.00716.55
7.3.240.0120.00616.79
7.3.230.0120.00616.55
7.3.210.0140.00416.51
7.3.200.0100.00719.39
7.3.190.0190.00016.58
7.3.180.0000.01516.38
7.3.170.0060.01016.62
7.3.160.0090.01216.80
7.3.120.0050.01315.02
7.3.110.0070.01014.99
7.3.100.0030.01215.02
7.3.90.0100.00314.70
7.3.80.0100.00715.07
7.3.70.0030.01015.07
7.3.60.0000.01515.06
7.3.50.0100.00315.14
7.3.40.0070.00715.07
7.3.30.0070.00714.85
7.3.20.0060.00616.96
7.3.10.0070.01117.03
7.3.00.0040.01116.91
7.2.330.0060.01216.74
7.2.320.0100.01316.92
7.2.310.0060.01217.00
7.2.300.0190.00316.79
7.2.290.0170.00016.86
7.2.250.0080.00815.24
7.2.240.0120.00414.92
7.2.230.0030.01315.05
7.2.220.0060.00615.13
7.2.210.0130.00314.97
7.2.200.0140.00415.34
7.2.190.0070.00714.93
7.2.180.0040.01115.41
7.2.170.0090.00315.14
7.1.330.0030.01416.16
7.1.320.0030.01016.28
7.1.310.0110.00315.82
7.1.300.0110.00315.95
7.1.290.0000.01315.91
7.1.280.0000.01116.10
7.1.270.0030.01215.95
7.1.260.0060.00916.02
7.1.70.0000.00817.34
7.1.60.0100.01319.70
7.1.50.0100.01917.24
7.1.00.0070.07322.29
7.0.200.0030.00617.03
7.0.140.0030.07022.05
7.0.60.0100.08319.86
7.0.50.0100.07717.83
7.0.40.0000.07020.29
7.0.30.0230.03720.20
7.0.20.0230.04020.22
7.0.10.0130.03720.18
7.0.00.0170.07720.17
5.6.280.0030.07320.79
5.6.210.0070.03720.77
5.6.200.0030.04018.17
5.6.190.0000.04720.27
5.6.180.0370.04320.39
5.6.170.0070.05020.67
5.6.160.0100.07720.50
5.6.150.0100.06318.20
5.6.140.0100.08318.12
5.6.130.0100.08318.09
5.6.120.0100.08720.98
5.6.110.0000.07021.14
5.6.100.0130.07721.05
5.6.90.0100.08020.98
5.6.80.0030.08320.39
5.5.350.0330.07320.35
5.5.340.0100.08017.93
5.5.330.0000.04320.20
5.5.320.0000.04320.13
5.5.310.0230.06020.17
5.5.300.0100.03317.92
5.5.290.0030.04717.95
5.5.280.0070.08720.86
5.5.270.0070.07020.67
5.5.260.0070.08020.87
5.5.250.0070.05720.55
5.5.240.0000.08020.13
5.4.450.0070.04319.55
5.4.440.0000.05019.41
5.4.430.0070.07319.45
5.4.420.0100.06319.26
5.4.410.0030.08019.11
5.4.400.0000.08019.08
5.4.390.0200.04018.88
5.4.380.0030.07019.15
5.4.370.0070.06318.96
5.4.360.0030.06019.13
5.4.350.0030.04019.13
5.4.340.0070.07019.06
5.4.320.0000.05018.95
5.4.310.0130.07018.88
5.4.300.0000.04319.13
5.4.290.0030.04019.08
5.4.280.0070.07319.27
5.4.270.0070.07718.82
5.4.260.0030.06019.08
5.4.250.0000.08319.09
5.4.240.0070.07319.12
5.4.230.0100.07018.92
5.4.220.0130.05019.08
5.4.210.0130.05718.78
5.4.200.0170.05018.78
5.4.190.0030.07718.94
5.4.180.0030.07319.23
5.4.170.0070.06019.08
5.4.160.0000.07718.76
5.4.150.0070.06319.07
5.4.140.0000.05016.35
5.4.130.0070.04016.37
5.4.120.0030.05016.35
5.4.110.0130.05316.20
5.4.100.0030.07316.41
5.4.90.0070.08016.23
5.4.80.0000.07716.39
5.4.70.0070.06716.37
5.4.60.0100.06016.43
5.4.50.0030.07316.45
5.4.40.0000.05316.04
5.4.30.0100.06316.43
5.4.20.0100.07016.17
5.4.10.0000.04716.22
5.4.00.0000.07015.89
5.3.290.0030.04014.62
5.3.280.0100.05714.46
5.3.270.0070.07714.54
5.3.260.0000.08014.47
5.3.250.0030.07714.66
5.3.240.0070.07314.64
5.3.230.0030.05014.54
5.3.220.0000.08014.67
5.3.210.0030.06714.53
5.3.200.0000.06014.63
5.3.190.0170.07014.52
5.3.180.0030.08014.54
5.3.170.0000.08014.55
5.3.160.0070.04314.41
5.3.150.0000.08014.52
5.3.140.0070.06314.44
5.3.130.0030.07314.40
5.3.120.0100.05314.46
5.3.110.0100.04314.43
5.3.100.0000.05013.89
5.3.90.0070.06713.98
5.3.80.0000.04313.93
5.3.70.0100.05313.82
5.3.60.0070.05713.96
5.3.50.0000.05313.91
5.3.40.0030.07313.79
5.3.30.0100.06713.96
5.3.20.0000.07713.48
5.3.10.0030.07013.51
5.3.00.0000.07313.55
5.2.170.0000.05712.23
5.2.160.0030.06712.23
5.2.150.0000.07012.23
5.2.140.0070.06312.23
5.2.130.0070.04312.23
5.2.120.0030.03712.23
5.2.110.0030.06012.23
5.2.100.0070.05712.23
5.2.90.0130.05012.23
5.2.80.0030.06312.23
5.2.70.0030.06712.23
5.2.60.0070.06012.23
5.2.50.0000.05712.23
5.2.40.0000.04712.23
5.2.30.0000.06312.23
5.2.20.0030.05012.23
5.2.10.0030.05012.23
5.2.00.0170.03712.23
5.1.60.0030.04012.23
5.1.50.0100.04712.23
5.1.40.0000.03312.23
5.1.30.0000.05712.23
5.1.20.0100.05012.23
5.1.10.0030.03312.23
5.1.00.0070.04312.23
5.0.50.0030.03312.23
5.0.40.0070.04012.23
5.0.30.0030.06712.23
5.0.20.0070.03012.23
5.0.10.0100.04012.23
5.0.00.0030.06012.23
4.4.90.0030.03012.23
4.4.80.0030.03012.23
4.4.70.0030.03312.23
4.4.60.0000.03712.23
4.4.50.0000.03712.23
4.4.40.0000.05012.23
4.4.30.0000.03012.23
4.4.20.0030.01712.23
4.4.10.0000.02712.23
4.4.00.0000.05012.23
4.3.110.0000.03712.23
4.3.100.0000.03012.23
4.3.90.0030.03012.23
4.3.80.0070.03312.23
4.3.70.0030.03312.23
4.3.60.0070.02712.23
4.3.50.0000.03312.23
4.3.40.0030.04712.23
4.3.30.0000.03312.23
4.3.20.0070.01712.23
4.3.10.0070.01312.23
4.3.00.0000.01712.23

preferences:
40.09 ms | 400 KiB | 5 Q