3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address = '5e Dorpsstraat 5-B'; $matchArr = array(); $matchesFound = preg_match('/(\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 . "\n"; print $houseNumber . "\n"; 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.0140.00318.56
8.3.60.0060.01316.88
8.3.50.0170.00521.99
8.3.40.0080.00818.96
8.3.30.0170.00319.13
8.3.20.0040.00420.21
8.3.10.0000.00723.61
8.3.00.0080.00020.84
8.2.180.0090.00616.75
8.2.170.0140.00722.96
8.2.160.0070.00720.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00420.91
8.2.110.0030.00620.30
8.2.100.0040.00717.97
8.2.90.0030.00519.09
8.2.80.0060.00317.97
8.2.70.0050.00317.61
8.2.60.0000.00917.93
8.2.50.0000.00818.07
8.2.40.0030.00518.34
8.2.30.0000.00718.28
8.2.20.0000.00717.77
8.2.10.0040.00418.02
8.2.00.0040.00417.87
8.1.280.0090.00625.92
8.1.270.0040.00423.79
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0070.00323.77
8.1.230.0000.01220.93
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0000.00917.47
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0030.00518.51
8.1.160.0030.00622.08
8.1.150.0040.00418.64
8.1.140.0070.00017.52
8.1.130.0060.00317.70
8.1.120.0040.00417.55
8.1.110.0040.00417.59
8.1.100.0000.00717.44
8.1.90.0000.00717.46
8.1.80.0000.00817.45
8.1.70.0000.00717.42
8.1.60.0030.00617.63
8.1.50.0040.00417.66
8.1.40.0000.00817.66
8.1.30.0030.00517.73
8.1.20.0040.00417.67
8.1.10.0000.00817.73
8.1.00.0030.00617.55
8.0.300.0050.00218.77
8.0.290.0000.00717.00
8.0.280.0070.00018.41
8.0.270.0030.00317.14
8.0.260.0000.00817.18
8.0.250.0000.00717.17
8.0.240.0000.00717.00
8.0.230.0000.00717.14
8.0.220.0070.00016.94
8.0.210.0040.00416.94
8.0.200.0030.00317.05
8.0.190.0000.00717.01
8.0.180.0000.00816.93
8.0.170.0040.00417.08
8.0.160.0040.00417.01
8.0.150.0030.00517.01
8.0.140.0000.00716.85
8.0.130.0000.00513.44
8.0.120.0000.00817.03
8.0.110.0030.00516.95
8.0.100.0040.00416.92
8.0.90.0040.00417.01
8.0.80.0120.00917.07
8.0.70.0080.00017.13
8.0.60.0070.00016.98
8.0.50.0070.00017.09
8.0.30.0150.00817.34
8.0.20.0150.00517.44
8.0.10.0000.00817.16
8.0.00.0140.00916.81
7.4.330.0060.00015.00
7.4.320.0030.00316.70
7.4.300.0030.00316.79
7.4.290.0030.00316.73
7.4.280.0000.00716.79
7.4.270.0030.00516.75
7.4.260.0030.00316.64
7.4.250.0040.00416.69
7.4.240.0020.00616.66
7.4.230.0070.00016.79
7.4.220.0060.01616.74
7.4.210.0110.00816.91
7.4.200.0000.00716.80
7.4.190.0000.00816.61
7.4.160.0090.00616.81
7.4.150.0090.00917.40
7.4.140.0090.01017.86
7.4.130.0100.00816.68
7.4.120.0080.00816.73
7.4.110.0030.01316.62
7.4.100.0140.00316.68
7.4.90.0070.01116.67
7.4.80.0120.00419.39
7.4.70.0030.01216.63
7.4.60.0100.00716.59
7.4.50.0000.00716.83
7.4.40.0130.00316.63
7.4.30.0110.00516.64
7.4.00.0040.01315.14
7.3.330.0000.00513.32
7.3.320.0000.00513.36
7.3.310.0040.00416.47
7.3.300.0020.00516.50
7.3.290.0200.00016.59
7.3.280.0080.00916.58
7.3.270.0090.00917.40
7.3.260.0110.01116.70
7.3.250.0120.01316.55
7.3.240.0060.01216.61
7.3.230.0100.00716.80
7.3.210.0070.01016.63
7.3.200.0060.01019.39
7.3.190.0130.00916.64
7.3.180.0100.00616.54
7.3.170.0130.00316.77
7.3.160.0100.00716.62
7.3.120.0100.00815.06
7.3.110.0100.01015.20
7.3.100.0090.00915.19
7.3.90.0070.00715.05
7.3.80.0030.01415.05
7.3.70.0040.00715.11
7.3.60.0110.00314.93
7.3.50.0090.00615.00
7.3.40.0040.01115.12
7.3.30.0050.00515.07
7.3.20.0080.00816.59
7.3.10.0050.01116.63
7.3.00.0040.00816.78
7.2.330.0090.00916.66
7.2.320.0000.01816.73
7.2.310.0090.00916.76
7.2.300.0090.00616.68
7.2.290.0070.01016.73
7.2.250.0100.00715.22
7.2.240.0030.01214.91
7.2.230.0030.01115.45
7.2.220.0040.01415.39
7.2.210.0030.01115.18
7.2.200.0070.00315.20
7.2.190.0080.00815.36
7.2.180.0070.00315.25
7.2.170.0070.00715.32
7.2.160.0040.01215.34
7.2.150.0120.00817.11
7.2.140.0030.01017.24
7.2.130.0080.00817.14
7.2.120.0090.00716.96
7.2.110.0060.00917.09
7.2.100.0100.00617.13
7.2.90.0080.00717.28
7.2.80.0070.00717.12
7.2.70.0070.00717.14
7.2.60.0030.00817.18
7.2.50.0080.00717.12
7.2.40.0030.01117.17
7.2.30.0080.00617.27
7.2.20.0070.00917.17
7.2.10.0030.01016.95
7.2.00.0070.00617.73
7.1.330.0130.00616.13
7.1.320.0100.00716.16
7.1.310.0000.01116.15
7.1.300.0030.00916.15
7.1.290.0040.01115.91
7.1.280.0030.00816.18
7.1.270.0040.01115.95
7.1.260.0040.00816.02
7.1.250.0030.01216.01
7.1.240.0000.01415.82
7.1.230.0060.00915.68
7.1.220.0040.01115.98
7.1.210.0030.01015.96
7.1.200.0000.01515.91
7.1.190.0000.00915.89
7.1.180.0030.00716.14
7.1.170.0090.00315.65
7.1.160.0060.00615.98
7.1.150.0110.00416.05
7.1.140.0080.00015.81
7.1.130.0000.00916.00
7.1.120.0070.00716.09
7.1.110.0080.00416.02
7.1.100.0110.01017.17
7.1.90.0040.01116.17
7.1.80.0000.01316.05
7.1.70.0030.01016.77
7.1.60.0100.01017.91
7.1.50.0140.00816.42
7.1.40.0030.01016.05
7.1.30.0030.01015.99
7.1.20.0110.00415.66
7.1.10.0060.00916.04
7.1.00.0090.03819.19
7.0.330.0080.00515.46
7.0.320.0090.00615.42
7.0.310.0070.00715.45
7.0.300.0000.01315.53
7.0.290.0070.00315.22
7.0.280.0030.00615.38
7.0.270.0080.00815.72
7.0.260.0070.00415.61
7.0.250.0000.01215.47
7.0.240.0130.00015.75
7.0.230.0120.00315.83
7.0.220.0000.01015.64
7.0.210.0090.00615.56
7.0.200.0050.00716.10
7.0.190.0040.01115.44
7.0.180.0030.01015.78
7.0.170.0040.00415.77
7.0.160.0060.00615.54
7.0.150.0060.01215.75
7.0.140.0090.03418.88
7.0.130.0060.00615.46
7.0.120.0060.00315.40
7.0.110.0000.01515.65
7.0.100.0090.00015.58
7.0.90.0090.00315.40
7.0.80.0040.00415.40
7.0.70.0060.00315.52
7.0.60.0050.04217.87
7.0.50.0080.04216.74
7.0.40.0050.04816.90
7.0.30.0100.02616.83
7.0.20.0130.04316.83
7.0.10.0080.02516.87
7.0.00.0120.04216.97
5.6.400.0040.00714.11
5.6.390.0000.01414.54
5.6.380.0040.00414.44
5.6.370.0040.01114.79
5.6.360.0070.00714.65
5.6.350.0100.00014.38
5.6.340.0090.00614.79
5.6.330.0060.00914.55
5.6.320.0030.00714.59
5.6.310.0030.00714.61
5.6.300.0060.00914.82
5.6.290.0000.01214.48
5.6.280.0080.03717.77
5.6.270.0120.00314.69
5.6.260.0070.00314.38
5.6.250.0060.00614.80
5.6.240.0000.01514.67
5.6.230.0100.00714.75
5.6.220.0060.00614.33
5.6.210.0050.04217.52
5.6.200.0030.03016.26
5.6.190.0020.02817.52
5.6.180.0190.03417.51
5.6.170.0180.02817.41
5.6.160.0060.04817.53
5.6.150.0120.03216.45
5.6.140.0050.04516.31
5.6.130.0060.02316.49
5.6.120.0050.02917.70
5.6.110.0100.04517.78
5.6.100.0040.02417.92
5.6.90.0060.04517.76
5.6.80.0080.04317.30
5.6.70.0000.01414.54
5.6.60.0070.00714.44
5.6.50.0090.00614.75
5.6.40.0070.01114.31
5.6.30.0040.01114.70
5.6.20.0070.01014.54
5.6.10.0040.01114.34
5.6.00.0040.00714.75
5.5.380.0030.01014.49
5.5.370.0110.00014.33
5.5.360.0090.00314.59
5.5.350.0030.02217.34
5.5.340.0030.04516.13
5.5.330.0080.03617.26
5.5.320.0230.04017.13
5.5.310.0120.02617.49
5.5.300.0080.03816.25
5.5.290.0080.04316.16
5.5.280.0070.04517.61
5.5.270.0050.02917.61
5.5.260.0060.02817.60
5.5.250.0050.04017.34
5.5.240.2100.02817.23
5.5.230.0030.01014.35
5.5.220.0000.01414.55
5.5.210.0080.00814.04
5.5.200.0040.00414.29
5.5.190.0070.00714.30
5.5.180.0000.01314.08
5.5.170.0040.01414.33
5.5.160.0070.00414.41
5.5.150.0040.00714.52
5.5.140.0030.00714.65
5.5.130.0040.01114.46
5.5.120.0040.01114.20
5.5.110.0070.00714.25
5.5.100.0060.00914.42
5.5.90.0070.00714.07
5.5.80.0030.00614.18
5.5.70.0030.00514.27
5.5.60.0060.00914.40
5.5.50.0030.01214.22
5.5.40.0080.00314.34
5.5.30.0100.00714.10
5.5.20.0060.00614.27
5.5.10.0000.01414.50
5.5.00.0030.01214.52
5.4.450.0080.01515.03
5.4.440.0120.02215.11
5.4.430.0270.02415.33
5.4.420.0180.02515.19
5.4.410.0100.02015.12
5.4.400.0100.02215.09
5.4.390.0110.02514.99
5.4.380.0080.03314.78
5.4.370.0140.03914.89
5.4.360.0070.03014.78
5.4.350.0110.03514.87
5.4.340.0180.03614.91
5.4.330.0050.00510.96
5.4.320.0040.02411.71
5.4.310.0060.02011.71
5.4.300.0040.02211.74
5.4.290.0050.02411.71
5.4.280.0060.02211.76
5.4.270.0030.02811.66
5.4.260.0040.02511.66
5.4.250.0050.02511.68
5.4.240.0070.02611.66
5.4.230.0060.02211.65
5.4.220.0080.01911.65
5.4.210.0060.02111.65
5.4.200.0030.02411.65
5.4.190.0040.02311.74
5.4.180.0080.02811.71
5.4.170.0100.04011.72
5.4.160.0050.03411.66
5.4.150.0070.03911.84
5.4.140.0070.01911.49
5.4.130.0060.02211.63
5.4.120.0080.02011.58
5.4.110.0050.02411.48
5.4.100.0040.02011.47
5.4.90.0040.02311.47
5.4.80.0040.02311.48
5.4.70.0050.02511.52
5.4.60.0060.02111.46
5.4.50.0040.02211.50
5.4.40.0050.02611.46
5.4.30.0110.03411.46
5.4.20.0080.01911.48
5.4.10.0100.03911.63
5.4.00.0080.02011.20
5.3.290.0070.02111.88
5.3.280.0020.02511.83
5.3.270.0070.02311.84
5.3.260.0060.02411.84
5.3.250.0070.02011.84
5.3.240.0070.02411.84
5.3.230.0060.02711.83
5.3.220.0070.02511.82
5.3.210.0040.02411.82
5.3.200.0050.02311.82
5.3.190.0040.03411.81
5.3.180.0060.02211.82
5.3.170.0080.02411.81
5.3.160.0030.02311.82
5.3.150.0020.02511.81
5.3.140.0090.02111.81
5.3.130.0020.02911.81
5.3.120.0020.02911.81
5.3.110.0050.02211.81
5.3.100.0040.04111.54
5.3.90.0020.02411.52
5.3.80.0080.01811.52
5.3.70.0080.02511.52
5.3.60.0060.02411.51
5.3.50.0070.02411.48
5.3.40.0080.02811.48
5.3.30.0050.02411.46
5.3.20.0090.02711.35
5.3.10.0090.02911.33
5.3.00.0040.02311.33
5.2.170.0030.0339.21
5.2.160.0050.0299.20
5.2.150.0040.0329.21
5.2.140.0060.0319.20
5.2.130.0060.0299.16
5.2.120.0040.0329.16
5.2.110.0060.0369.16
5.2.100.0080.0369.16
5.2.90.0070.0419.16
5.2.80.0080.0319.16
5.2.70.0030.0419.16
5.2.60.0070.0279.12
5.2.50.0060.0379.08
5.2.40.0040.0309.06
5.2.30.0070.0369.04
5.2.20.0050.0379.03
5.2.10.0070.0278.93
5.2.00.0050.0328.79
5.1.60.0020.0288.10
5.1.50.0030.0288.09
5.1.40.0050.0288.07
5.1.30.0100.0368.42
5.1.20.0090.0518.44
5.1.10.0060.0358.17
5.1.00.0090.0438.17
5.0.50.0060.0266.65
5.0.40.0040.0216.51
5.0.30.0130.0706.32
5.0.20.0070.0206.29
5.0.10.0030.0226.26
5.0.00.0020.0346.26
4.4.90.0020.0184.78
4.4.80.0040.0154.75
4.4.70.0040.0184.75
4.4.60.0050.0254.75
4.4.50.0040.0194.77
4.4.40.0080.0354.71
4.4.30.0040.0214.76
4.4.20.0050.0164.85
4.4.10.0050.0174.85
4.4.00.0070.0294.75
4.3.110.0050.0254.67
4.3.100.0030.0274.67
4.3.90.0040.0244.63
4.3.80.0080.0314.58
4.3.70.0110.0204.63
4.3.60.0050.0214.62
4.3.50.0050.0234.63
4.3.40.0020.0384.54
4.3.30.0030.0183.28
4.3.20.0020.0323.26
4.3.10.0040.0243.22
4.3.00.0000.02016.93

preferences:
41.75 ms | 401 KiB | 5 Q