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.70.0070.00716.75
8.3.60.0170.00318.43
8.3.50.0120.00321.98
8.3.40.0170.00318.96
8.3.30.0070.00719.21
8.3.20.0040.00420.19
8.3.10.0030.00523.53
8.3.00.0080.00019.02
8.2.180.0120.00616.88
8.2.170.0090.00622.96
8.2.160.0070.00720.36
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0000.01426.16
8.2.120.0050.00320.99
8.2.110.0040.00721.13
8.2.100.0070.00418.03
8.2.90.0080.00319.07
8.2.80.0050.00317.97
8.2.70.0060.00617.88
8.2.60.0000.01019.65
8.2.50.0030.00618.07
8.2.40.0030.00520.19
8.2.30.0000.00818.37
8.2.20.0040.00417.77
8.2.10.0000.00718.20
8.2.00.0000.00817.76
8.1.280.0100.00625.92
8.1.270.0000.00823.72
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0090.00019.40
8.1.230.0070.00321.03
8.1.220.0000.00818.66
8.1.210.0000.00819.16
8.1.200.0040.00417.47
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0030.00518.61
8.1.160.0040.00421.95
8.1.150.0000.00718.71
8.1.140.0040.00417.41
8.1.130.0000.00717.91
8.1.120.0000.00817.44
8.1.110.0000.00717.43
8.1.100.0000.00817.52
8.1.90.0000.00717.54
8.1.80.0000.00717.59
8.1.70.0000.00717.50
8.1.60.0050.00517.63
8.1.50.0050.00317.62
8.1.40.0000.00817.59
8.1.30.0040.00417.57
8.1.20.0080.00017.79
8.1.10.0040.00417.65
8.1.00.0060.00317.66
8.0.300.0030.00719.98
8.0.290.0050.00318.62
8.0.280.0040.00418.45
8.0.270.0000.00717.38
8.0.260.0030.00317.20
8.0.250.0000.00717.05
8.0.240.0000.00717.01
8.0.230.0030.00316.95
8.0.220.0030.00316.92
8.0.210.0000.00717.05
8.0.200.0000.00617.05
8.0.190.0000.00716.99
8.0.180.0080.00017.06
8.0.170.0050.00317.04
8.0.160.0000.00717.03
8.0.150.0040.00417.01
8.0.140.0000.00716.90
8.0.130.0000.00613.39
8.0.120.0000.00817.00
8.0.110.0000.00716.97
8.0.100.0000.00717.09
8.0.90.0040.00416.99
8.0.80.0100.00717.09
8.0.70.0040.00416.86
8.0.60.0040.00417.05
8.0.50.0040.00416.99
8.0.30.0110.01617.40
8.0.20.0110.00817.40
8.0.10.0000.00816.98
8.0.00.0130.00616.94
7.4.330.0020.00215.00
7.4.320.0040.00416.66
7.4.300.0000.00616.69
7.4.290.0000.00716.80
7.4.280.0060.00316.75
7.4.270.0070.00016.64
7.4.260.0040.00416.67
7.4.250.0040.00416.72
7.4.240.0050.00216.72
7.4.230.0050.00216.79
7.4.220.0110.00716.85
7.4.210.0050.01116.76
7.4.200.0080.00016.88
7.4.190.0000.00816.68
7.4.160.0100.00716.77
7.4.150.0070.01017.40
7.4.140.0090.00917.86
7.4.130.0100.00916.75
7.4.120.0100.00816.81
7.4.110.0090.00816.70
7.4.100.0090.00916.62
7.4.90.0000.01716.69
7.4.80.0070.01019.39
7.4.70.0030.01316.59
7.4.60.0060.01816.57
7.4.50.0030.00316.85
7.4.40.0130.00316.61
7.4.30.0110.00616.59
7.4.10.0000.01815.10
7.4.00.0100.00815.03
7.3.330.0060.00013.39
7.3.320.0020.00213.40
7.3.310.0000.00716.33
7.3.300.0030.00516.45
7.3.290.0120.00316.53
7.3.280.0070.01016.53
7.3.270.0130.00417.40
7.3.260.0060.01216.45
7.3.250.0110.00716.51
7.3.240.0070.01016.62
7.3.230.0140.00916.66
7.3.210.0070.01316.80
7.3.200.0090.01319.39
7.3.190.0070.01416.79
7.3.180.0080.00816.54
7.3.170.0130.00916.68
7.3.160.0130.00316.49
7.3.130.0110.00315.14
7.3.120.0030.01415.16
7.3.110.0070.01115.23
7.3.100.0070.01014.71
7.3.90.0060.00714.65
7.3.80.0040.01114.89
7.3.70.0040.01115.02
7.3.60.0070.00714.86
7.3.50.0070.00715.17
7.3.40.0090.00615.06
7.3.30.0120.00615.19
7.3.20.0050.00516.47
7.3.10.0060.00616.93
7.3.00.0080.00016.85
7.2.330.0090.00916.95
7.2.320.0100.01416.79
7.2.310.0120.00616.74
7.2.300.0070.01316.95
7.2.290.0110.00816.82
7.2.260.0030.01315.36
7.2.250.0040.01415.34
7.2.240.0080.00415.22
7.2.230.0070.00715.30
7.2.220.0040.01515.25
7.2.210.0000.01415.07
7.2.200.0030.00915.30
7.2.190.0030.01015.07
7.2.180.0070.00415.07
7.2.170.0110.00715.26
7.2.160.0070.00815.16
7.2.150.0000.01117.37
7.2.140.0060.00617.07
7.2.130.0090.00016.82
7.2.120.0060.00617.04
7.2.110.0000.00816.78
7.2.100.0070.00416.93
7.2.90.0000.01117.35
7.2.80.0070.00717.26
7.2.70.0060.01016.98
7.2.60.0030.00917.01
7.2.50.0070.01117.24
7.2.40.0030.00616.97
7.2.30.0000.01116.98
7.2.20.0100.01017.34
7.2.10.0040.01417.13
7.2.00.0090.00418.30
7.1.330.0040.01216.15
7.1.320.0040.01216.17
7.1.310.0090.00615.95
7.1.300.0100.00715.98
7.1.290.0040.01115.96
7.1.280.0030.01016.05
7.1.270.0030.01015.94
7.1.260.0090.00616.09
7.1.250.0050.00516.09
7.1.240.0000.01316.17
7.1.230.0040.00716.06
7.1.220.0030.00715.88
7.1.210.0000.01216.09
7.1.200.0040.00415.99
7.1.190.0060.00915.91
7.1.180.0130.00315.84
7.1.170.0030.00715.94
7.1.160.0040.01115.86
7.1.150.0000.01115.81
7.1.140.0050.00516.11
7.1.130.0080.00515.86
7.1.120.0030.01416.02
7.1.110.0000.01315.81
7.1.100.0000.01015.75
7.1.90.0000.01515.99
7.1.80.0000.01416.14
7.1.70.0030.00616.71
7.1.60.0070.00716.84
7.1.50.0050.01316.49
7.1.40.0030.01016.16
7.1.30.0060.00616.09
7.1.20.0040.00415.95
7.1.10.0030.00715.99
7.1.00.0030.04419.17
7.0.330.0030.00715.69
7.0.320.0000.00715.75
7.0.310.0040.00715.66
7.0.300.0080.00015.68
7.0.290.0040.00815.66
7.0.280.0060.00315.49
7.0.270.0130.00715.25
7.0.260.0030.01015.63
7.0.250.0040.00815.47
7.0.240.0070.00715.86
7.0.230.0040.00415.70
7.0.220.0040.00815.71
7.0.210.0070.00715.68
7.0.200.0060.00816.26
7.0.190.0060.00615.80
7.0.180.0080.00315.57
7.0.170.0070.00315.65
7.0.160.0100.00315.61
7.0.150.0140.00015.60
7.0.140.0090.03818.83
7.0.130.0070.00615.54
7.0.120.0100.00315.73
7.0.110.0030.01315.29
7.0.100.0030.01415.79
7.0.90.0040.01215.68
7.0.80.0060.00615.40
7.0.70.0030.01315.32
7.0.60.0030.03017.70
7.0.50.0060.04416.90
7.0.40.0050.04616.82
7.0.30.0190.03716.82
7.0.20.0180.02816.74
7.0.10.0070.04016.95
7.0.00.0100.04717.06
5.6.400.0040.00414.63
5.6.390.0030.00714.57
5.6.380.0060.00613.97
5.6.370.0050.00314.57
5.6.360.0080.00314.26
5.6.350.0000.01514.76
5.6.340.0070.00314.82
5.6.330.0060.00814.69
5.6.320.0100.00014.68
5.6.310.0000.01414.83
5.6.300.0000.00914.64
5.6.290.0070.00714.40
5.6.280.0060.03717.57
5.6.270.0040.01114.36
5.6.260.0060.00814.31
5.6.250.0060.01214.72
5.6.240.0040.00814.40
5.6.230.0030.00814.75
5.6.220.0120.00314.52
5.6.210.0080.04217.58
5.6.200.0100.04216.35
5.6.190.0110.03817.34
5.6.180.0170.02917.41
5.6.170.0100.03117.54
5.6.160.0080.04417.45
5.6.150.0070.04716.39
5.6.140.0020.04016.28
5.6.130.0090.04516.25
5.6.120.0090.04417.63
5.6.110.0050.03517.93
5.6.100.0050.02617.78
5.6.90.0050.04917.83
5.6.80.0100.03017.36
5.6.70.0070.00714.35
5.6.60.0100.00714.57
5.6.50.0030.00714.52
5.6.40.0000.00914.49
5.6.30.0030.00914.51
5.6.20.0030.01314.66
5.6.10.0050.00314.60
5.6.00.0120.00314.42
5.5.380.0100.00314.31
5.5.370.0100.00314.53
5.5.360.0090.00314.16
5.5.350.0200.04217.48
5.5.340.0160.01716.04
5.5.330.0030.05017.25
5.5.320.0080.03317.33
5.5.310.0130.02317.38
5.5.300.0060.02816.24
5.5.290.0070.04316.26
5.5.280.0050.04417.78
5.5.270.0070.04417.59
5.5.260.0070.04517.75
5.5.250.0050.04417.34
5.5.240.0070.04017.29
5.5.230.0030.01014.04
5.5.220.0000.00814.04
5.5.210.0070.00714.15
5.5.200.0060.00314.06
5.5.190.0060.00814.29
5.5.180.0040.00414.29
5.5.170.0070.01014.32
5.5.160.0110.00414.43
5.5.150.0080.00514.46
5.5.140.0060.00614.39
5.5.130.0040.00714.17
5.5.120.0030.01014.31
5.5.110.0050.00514.41
5.5.100.0030.01314.24
5.5.90.0060.00914.55
5.5.80.0000.00914.45
5.5.70.0040.00814.41
5.5.60.0030.01014.32
5.5.50.0030.01014.21
5.5.40.0060.00313.98
5.5.30.0040.00814.11
5.5.20.0030.01014.21
5.5.10.0090.00614.11
5.5.00.0030.00614.29
5.4.450.0370.03116.17
5.4.440.0520.02516.03
5.4.430.0450.03316.13
5.4.420.0210.03916.13
5.4.410.0470.03315.95
5.4.400.0350.03216.04
5.4.390.0450.02515.87
5.4.380.0170.02915.66
5.4.370.0170.02615.75
5.4.360.0180.03415.64
5.4.350.0210.03115.63
5.4.340.0240.02515.61
5.4.330.0060.00612.79
5.4.320.0060.02212.62
5.4.310.0020.02512.62
5.4.300.0050.02712.63
5.4.290.0090.02312.62
5.4.280.0040.02212.57
5.4.270.0030.02612.57
5.4.260.0040.02512.57
5.4.250.0060.02412.57
5.4.240.0100.02412.57
5.4.230.0110.02712.57
5.4.220.0070.03612.57
5.4.210.0060.03512.57
5.4.200.0040.02312.57
5.4.190.0050.02812.56
5.4.180.0080.01812.56
5.4.170.0030.02212.57
5.4.160.0050.02112.57
5.4.150.0070.02112.57
5.4.140.0060.03212.41
5.4.130.0060.02212.40
5.4.120.0050.02012.38
5.4.110.0060.02512.38
5.4.100.0060.02112.38
5.4.90.0060.02312.38
5.4.80.0060.02112.38
5.4.70.0050.01912.38
5.4.60.0090.01812.38
5.4.50.0050.02212.38
5.4.40.0050.02312.37
5.4.30.0020.02312.37
5.4.20.0040.02012.37
5.4.10.0020.02312.37
5.4.00.0060.02112.12
5.3.290.0060.02512.80
5.3.280.0050.02312.75
5.3.270.0060.02112.76
5.3.260.0040.02412.76
5.3.250.0040.02412.76
5.3.240.0020.02512.75
5.3.230.0060.02212.75
5.3.220.0080.02212.74
5.3.210.0140.04512.73
5.3.200.0090.02312.73
5.3.190.0050.03012.74
5.3.180.0070.02712.73
5.3.170.0090.02712.73
5.3.160.0050.03112.73
5.3.150.0050.02512.73
5.3.140.0070.03312.73
5.3.130.0040.02612.72
5.3.120.0050.02512.73
5.3.110.0020.02512.73
5.3.100.0040.02112.46
5.3.90.0050.02212.44
5.3.80.0080.01612.43
5.3.70.0050.02012.44
5.3.60.0020.02412.43
5.3.50.0030.02312.40
5.3.40.0060.02212.40
5.3.30.0020.02512.38
5.3.20.0050.02212.26
5.3.10.0040.02312.25
5.3.00.0060.01912.24
5.2.170.0040.0319.19
5.2.160.0050.0309.19
5.2.150.0080.0279.19
5.2.140.0070.0289.19
5.2.130.0070.0279.15
5.2.120.0050.0419.15
5.2.110.0070.0309.16
5.2.100.0050.0329.15
5.2.90.0060.0289.15
5.2.80.0040.0309.15
5.2.70.0090.0309.15
5.2.60.0050.0349.10
5.2.50.0020.0339.07
5.2.40.0070.0289.05
5.2.30.0040.0309.03
5.2.20.0050.0289.02
5.2.10.0070.0248.92
5.2.00.0030.0308.78
5.1.60.0050.0238.07
5.1.50.0030.0258.06
5.1.40.0050.0238.04
5.1.30.0050.0258.39
5.1.20.0040.0268.41
5.1.10.0060.0358.14
5.1.00.0050.0278.14
5.0.50.0050.0286.63
5.0.40.0040.0246.49
5.0.30.0040.0306.30
5.0.20.0020.0216.27
5.0.10.0040.0206.25
5.0.00.0040.0316.25
4.4.90.0000.0184.78
4.4.80.0050.0154.76
4.4.70.0060.0134.75
4.4.60.0040.0134.75
4.4.50.0000.0184.77
4.4.40.0030.0254.71
4.4.30.0030.0154.76
4.4.20.0010.0174.84
4.4.10.0050.0134.85
4.4.00.0030.0254.76
4.3.110.0020.0164.67
4.3.100.0030.0144.66
4.3.90.0040.0134.64
4.3.80.0010.0264.58
4.3.70.0030.0144.63
4.3.60.0020.0154.63
4.3.50.0030.0154.63
4.3.40.0020.0254.54
4.3.30.0040.0143.29
4.3.20.0030.0153.27
4.3.10.0020.0153.23
4.3.00.0000.02016.93

preferences:
44.01 ms | 401 KiB | 5 Q