3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address = '5e Dorpsstraat 5-B'; $matchArr = array(); $matchesFound = preg_match_all('/(\d+)/', $address, $matchArr); $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.0080.00818.68
8.3.50.0090.01122.02
8.3.40.0140.00018.89
8.3.30.0100.00319.09
8.3.20.0000.00720.34
8.3.10.0060.00323.48
8.3.00.0040.00420.65
8.2.180.0170.00316.63
8.2.170.0110.00422.96
8.2.160.0070.00720.53
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0110.00426.16
8.2.120.0040.00421.03
8.2.110.0090.00022.20
8.2.100.0060.00619.70
8.2.90.0040.00419.20
8.2.80.0080.00017.97
8.2.70.0000.00817.88
8.2.60.0030.00618.05
8.2.50.0000.00918.07
8.2.40.0000.00718.34
8.2.30.0070.00018.27
8.2.20.0000.00817.81
8.2.10.0040.00418.09
8.2.00.0050.00217.91
8.1.280.0110.00425.92
8.1.270.0030.00523.91
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00323.69
8.1.230.0000.01119.13
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0030.00717.48
8.1.190.0040.00417.47
8.1.180.0000.00818.10
8.1.170.0050.00318.59
8.1.160.0040.00421.83
8.1.150.0000.00718.75
8.1.140.0050.00317.53
8.1.130.0000.00717.95
8.1.120.0070.00017.40
8.1.110.0040.00417.50
8.1.100.0040.00417.43
8.1.90.0000.00717.56
8.1.80.0040.00417.54
8.1.70.0080.00017.50
8.1.60.0040.00417.68
8.1.50.0080.00017.62
8.1.40.0030.00617.45
8.1.30.0040.00417.57
8.1.20.0040.00417.78
8.1.10.0040.00417.56
8.1.00.0040.00417.61
8.0.300.0000.00718.77
8.0.290.0080.00017.04
8.0.280.0070.00018.47
8.0.270.0040.00417.19
8.0.260.0060.00017.20
8.0.250.0000.00717.14
8.0.240.0030.00317.08
8.0.230.0040.00416.98
8.0.220.0030.00316.98
8.0.210.0030.00316.93
8.0.200.0030.00316.97
8.0.190.0040.00417.06
8.0.180.0040.00417.06
8.0.170.0090.00016.96
8.0.160.0070.00016.97
8.0.150.0030.00517.02
8.0.140.0000.00816.95
8.0.130.0030.00313.42
8.0.120.0030.00616.89
8.0.110.0000.00816.86
8.0.100.0000.00717.02
8.0.90.0070.00016.92
8.0.80.0060.01017.06
8.0.70.0040.00417.08
8.0.60.0000.00716.84
8.0.50.0050.00217.08
8.0.30.0090.01317.28
8.0.20.0110.00817.40
8.0.10.0020.00517.16
8.0.00.0120.00916.79
7.4.330.0030.00215.00
7.4.320.0000.00616.77
7.4.300.0000.00716.72
7.4.290.0070.00016.71
7.4.280.0070.00016.75
7.4.270.0070.00016.63
7.4.260.0000.00716.67
7.4.250.0040.00416.71
7.4.240.0030.00516.75
7.4.230.0070.00016.70
7.4.220.0110.00716.68
7.4.210.0110.00316.89
7.4.200.0000.00716.73
7.4.190.0000.00916.67
7.4.160.0080.00816.48
7.4.150.0070.01017.40
7.4.140.0060.01217.86
7.4.130.0080.01016.70
7.4.120.0090.01016.73
7.4.110.0100.00716.73
7.4.100.0060.01516.80
7.4.90.0140.00416.80
7.4.80.0060.01219.39
7.4.70.0030.01316.49
7.4.60.0110.00716.66
7.4.50.0000.00416.48
7.4.40.0120.00416.69
7.4.30.0150.00616.60
7.4.00.0070.01014.91
7.3.330.0030.00613.24
7.3.320.0000.00613.24
7.3.310.0000.00816.43
7.3.300.0000.00716.50
7.3.290.0060.01316.39
7.3.280.0070.01016.50
7.3.270.0140.00417.40
7.3.260.0110.00716.42
7.3.250.0080.01016.77
7.3.240.0000.01816.46
7.3.230.0060.01216.80
7.3.210.0250.02116.43
7.3.200.0090.01319.39
7.3.190.0060.01216.78
7.3.180.0090.00616.46
7.3.170.0100.00716.71
7.3.160.0080.00816.85
7.3.120.0030.00915.03
7.2.330.0060.01216.64
7.2.320.0000.01816.75
7.2.310.0090.00916.80
7.2.300.0080.00816.61
7.2.290.0120.01016.76
7.2.60.0100.00316.85
7.2.50.0190.00916.61
7.1.200.0060.00616.15
7.1.70.0040.00417.34
7.1.60.0090.01619.70
7.1.50.0180.01135.10
7.1.00.0070.07322.35
7.0.200.0070.00016.93
7.0.140.0030.07322.12
7.0.60.0070.05319.86
7.0.50.0030.05017.82
7.0.40.0100.08720.22
7.0.30.0270.08020.18
7.0.20.0170.04020.03
7.0.10.0130.08020.34
7.0.00.0070.06020.03
5.6.280.0030.07321.12
5.6.210.0030.08720.63
5.6.200.0100.03718.16
5.6.190.0030.04320.35
5.6.180.0200.04020.63
5.6.170.0170.04020.38
5.6.160.0170.07320.51
5.6.150.0070.08018.16
5.6.140.0030.04018.08
5.6.130.0070.07318.18
5.6.120.0030.05021.03
5.6.110.0130.07720.99
5.6.100.0170.07321.13
5.6.90.0100.08320.96
5.6.80.0130.07320.36
5.5.350.0070.07720.44
5.5.340.0030.07017.99
5.5.330.0030.08720.29
5.5.320.0130.07020.17
5.5.310.0270.07020.15
5.5.300.0030.04017.88
5.5.290.0030.04718.01
5.5.280.0000.04720.87
5.5.270.0130.07720.87
5.5.260.0030.08320.79
5.5.250.0230.05720.46
5.5.240.3930.04020.26
5.4.450.0270.03319.42
5.4.440.0570.04319.42
5.4.430.0700.04319.48
5.4.420.0200.03719.40
5.4.410.0670.04319.33
5.4.400.0500.04019.10
5.4.390.0230.03719.20
5.4.380.0330.06318.70
5.4.370.0400.05318.68
5.4.360.0400.06318.70
5.4.350.0330.05718.73
5.4.340.0230.06318.50
5.4.320.0090.03412.45
5.4.310.0070.03812.45
5.4.300.0070.04312.46
5.4.290.0070.03912.45
5.4.280.0090.04012.35
5.4.270.0090.03912.35
5.4.260.0030.04012.35
5.4.250.0060.03712.35
5.4.240.0040.03812.35
5.4.230.0070.03912.34
5.4.220.0080.03312.34
5.4.210.0120.04512.34
5.4.200.0050.04112.34
5.4.190.0080.03912.34
5.4.180.0080.04112.34
5.4.170.0090.04612.35
5.4.160.0080.04212.35
5.4.150.0100.04512.34
5.4.140.0050.05312.03
5.4.130.0120.03612.02
5.4.120.0080.05011.97
5.4.110.0130.04711.97
5.4.100.0080.04211.96
5.4.90.0080.04811.96
5.4.80.0050.04511.96
5.4.70.0050.04311.96
5.4.60.0030.03811.96
5.4.50.0070.04711.97
5.4.40.0120.04411.95
5.4.30.0070.03611.95
5.4.20.0080.03411.95
5.4.10.0070.04011.95
5.4.00.0090.03411.44
5.3.290.0080.03912.80
5.3.280.0040.03912.71
5.3.270.0080.03712.72
5.3.260.0050.04012.72
5.3.250.0090.03612.72
5.3.240.0080.03612.72
5.3.230.0070.04012.71
5.3.220.0090.03612.68
5.3.210.0050.03912.68
5.3.200.0020.04012.68
5.3.190.0050.04012.68
5.3.180.0080.03812.68
5.3.170.0060.03712.67
5.3.160.0060.04712.67
5.3.150.0060.05212.67
5.3.140.0090.03512.66
5.3.130.0070.03912.66
5.3.120.0100.03512.66
5.3.110.0090.03612.66
5.3.100.0090.03612.12
5.3.90.0070.03712.09
5.3.80.0050.04212.07
5.3.70.0100.03212.07
5.3.60.0110.03212.07
5.3.50.0070.03612.00
5.3.40.0080.03512.00
5.3.30.0050.03611.95
5.3.20.0080.03511.72
5.3.10.0060.03511.69
5.3.00.0060.03711.68
5.2.170.0070.0299.18
5.2.160.0070.0279.18
5.2.150.0070.0299.18
5.2.140.0060.0309.18
5.2.130.0070.0309.14
5.2.120.0070.0359.14
5.2.110.0050.0389.14
5.2.100.0080.0429.14
5.2.90.0030.0379.14
5.2.80.0040.0319.14
5.2.70.0040.0329.14
5.2.60.0030.0329.09
5.2.50.0090.0319.06
5.2.40.0060.0379.04
5.2.30.0100.0429.02
5.2.20.0090.0389.01
5.2.10.0070.0378.93
5.2.00.0070.0368.79
5.1.60.0070.0328.07
5.1.50.0130.0268.06
5.1.40.0090.0318.05
5.1.30.0060.0358.39
5.1.20.0070.0358.41
5.1.10.0060.0358.14
5.1.00.0040.0258.14
5.0.50.0040.0206.63
5.0.40.0030.0206.49
5.0.30.0080.0286.30
5.0.20.0050.0196.28
5.0.10.0050.0226.25
5.0.00.0060.0346.25
4.4.90.0020.0184.78
4.4.80.0030.0164.75
4.4.70.0030.0164.76
4.4.60.0030.0154.75
4.4.50.0030.0154.77
4.4.40.0010.0304.70
4.4.30.0150.0444.76
4.4.20.0040.0174.85
4.4.10.0020.0244.85
4.4.00.0030.0264.75
4.3.110.0040.0224.67
4.3.100.0040.0214.66
4.3.90.0040.0214.64
4.3.80.0010.0274.58
4.3.70.0040.0144.63
4.3.60.0040.0164.62
4.3.50.0050.0214.63
4.3.40.0050.0344.53
4.3.30.0030.0223.30
4.3.20.0020.0203.27
4.3.10.0050.0213.23
4.3.00.0000.02016.93

preferences:
41.91 ms | 401 KiB | 5 Q