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 . " / "; 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.0140.00418.68
8.3.60.0110.00416.60
8.3.50.0060.01222.05
8.3.40.0120.00919.23
8.3.30.0110.00419.17
8.3.20.0000.00820.34
8.3.10.0040.00423.68
8.3.00.0050.00320.95
8.2.180.0110.00417.13
8.2.170.0110.00422.96
8.2.160.0070.00720.35
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00421.04
8.2.110.0040.00422.25
8.2.100.0090.00317.97
8.2.90.0040.00418.98
8.2.80.0080.00017.97
8.2.70.0030.00617.75
8.2.60.0030.00517.93
8.2.50.0030.00518.07
8.2.40.0050.00318.16
8.2.30.0050.00218.33
8.2.20.0040.00417.90
8.2.10.0000.00818.04
8.2.00.0040.00417.89
8.1.280.0100.00725.92
8.1.270.0040.00423.88
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00423.98
8.1.230.0030.00717.52
8.1.220.0030.00617.75
8.1.210.0080.00018.77
8.1.200.0030.00717.35
8.1.190.0090.00017.35
8.1.180.0040.00418.10
8.1.170.0030.00518.52
8.1.160.0040.00421.93
8.1.150.0040.00418.77
8.1.140.0030.00517.52
8.1.130.0040.00417.75
8.1.120.0050.00217.46
8.1.110.0080.00017.46
8.1.100.0040.00417.50
8.1.90.0070.00017.53
8.1.80.0000.00817.55
8.1.70.0000.00717.56
8.1.60.0040.00417.63
8.1.50.0030.00517.69
8.1.40.0040.00417.71
8.1.30.0040.00417.73
8.1.20.0040.00417.67
8.1.10.0080.00017.71
8.1.00.0020.00517.57
8.0.300.0040.00418.77
8.0.290.0000.00816.88
8.0.280.0030.00318.46
8.0.270.0000.00717.32
8.0.260.0000.00617.12
8.0.250.0030.00317.09
8.0.240.0060.00017.15
8.0.230.0070.00017.00
8.0.220.0060.00317.11
8.0.210.0000.00717.04
8.0.200.0040.00417.12
8.0.190.0030.00516.98
8.0.180.0000.00717.05
8.0.170.0040.00417.09
8.0.160.0040.00417.01
8.0.150.0050.00216.89
8.0.140.0050.00217.00
8.0.130.0000.00613.51
8.0.120.0000.00816.96
8.0.110.0040.00416.99
8.0.100.0000.00716.99
8.0.90.0040.00416.82
8.0.80.0120.00617.06
8.0.70.0040.00416.94
8.0.60.0000.00717.11
8.0.50.0000.00717.04
8.0.30.0150.00717.32
8.0.20.0070.01117.47
8.0.10.0000.00717.12
8.0.00.0070.01716.78
7.4.330.0000.00515.00
7.4.320.0000.00716.57
7.4.300.0000.00616.75
7.4.290.0030.00316.78
7.4.280.0080.00016.80
7.4.270.0050.00316.71
7.4.260.0000.00716.79
7.4.250.0040.00416.82
7.4.240.0010.00616.69
7.4.230.0030.00316.60
7.4.220.0110.00716.73
7.4.210.0100.00316.71
7.4.200.0040.00416.74
7.4.190.0030.00616.66
7.4.160.0080.01516.63
7.4.150.0070.01017.40
7.4.140.0070.01017.86
7.4.130.0080.00816.65
7.4.120.0100.00716.82
7.4.110.0130.00316.75
7.4.100.0130.00316.67
7.4.90.0070.01116.72
7.4.80.0070.01119.39
7.4.70.0140.00716.88
7.4.60.0130.00316.63
7.4.50.0030.00616.79
7.4.40.0100.00616.75
7.4.30.0070.01016.73
7.4.10.0150.00315.22
7.4.00.0080.00915.23
7.3.330.0060.00013.42
7.3.320.0060.00013.46
7.3.310.0080.00016.37
7.3.300.0030.00316.53
7.3.290.0080.00616.51
7.3.280.0100.00716.52
7.3.270.0030.01417.40
7.3.260.0080.01216.71
7.3.250.0100.00716.68
7.3.240.0100.00716.63
7.3.230.0070.01116.62
7.3.210.0070.01016.49
7.3.200.0170.00219.39
7.3.190.0130.01016.81
7.3.180.0110.00616.79
7.3.170.0120.00316.56
7.3.160.0070.01016.42
7.3.130.0100.00714.77
7.3.120.0070.01115.18
7.3.110.0080.01015.04
7.3.100.0110.00415.09
7.3.90.0020.01214.95
7.3.80.0060.01015.28
7.3.70.0020.01115.05
7.3.60.0090.00614.97
7.3.50.0040.01015.06
7.3.40.0050.00915.08
7.3.30.0060.00814.88
7.3.20.0070.00816.75
7.3.10.0080.00516.90
7.3.00.0070.00616.82
7.2.330.0060.01216.80
7.2.320.0150.00616.68
7.2.310.0120.00616.82
7.2.300.0030.01416.70
7.2.290.0120.00916.91
7.2.260.0100.01015.49
7.2.250.0120.00715.24
7.2.240.0090.00915.33
7.2.230.0050.01215.17
7.2.220.0050.01115.25
7.2.210.0070.00915.27
7.2.200.0100.00715.20
7.2.190.0070.00815.17
7.2.180.0090.00615.22
7.2.170.0080.00815.21
7.2.160.0060.00915.25
7.2.150.0070.01117.03
7.2.140.0000.01017.08
7.2.130.0090.00516.90
7.2.120.0050.01116.96
7.2.110.0050.00817.16
7.2.100.0040.01116.85
7.2.90.0070.00817.32
7.2.80.0080.00616.98
7.2.70.0100.00417.18
7.2.60.0100.00517.11
7.2.50.0050.01017.00
7.2.40.0090.00617.04
7.2.30.0060.00617.18
7.2.20.0060.01017.19
7.2.10.0050.00817.17
7.2.00.0090.00917.88
7.1.330.0060.00716.04
7.1.320.0050.00816.06
7.1.310.0060.00916.11
7.1.300.0050.00716.05
7.1.290.0050.00815.84
7.1.280.0080.00615.94
7.1.270.0060.00716.05
7.1.260.0080.00616.01
7.1.250.0050.00815.96
7.1.240.0020.01116.03
7.1.230.0050.01115.83
7.1.220.0040.00816.07
7.1.210.0050.00715.90
7.1.200.0070.00915.89
7.1.190.0050.00815.88
7.1.180.0140.00015.97
7.1.170.0050.00816.00
7.1.160.0090.00316.00
7.1.150.0080.00515.98
7.1.140.0060.00816.11
7.1.130.0060.00316.06
7.1.120.0080.00715.96
7.1.110.0030.00716.09
7.1.100.0050.00716.68
7.1.90.0000.01216.02
7.1.80.0070.01016.11
7.1.70.0010.01216.48
7.1.60.0090.00717.27
7.1.50.0060.01216.29
7.1.40.0070.00516.07
7.1.30.0030.01115.96
7.1.20.0070.00516.06
7.1.10.0050.01015.72
7.1.00.0100.02318.00
7.0.330.0070.00715.68
7.0.320.0080.00615.39
7.0.310.0050.00915.51
7.0.300.0060.00615.66
7.0.290.0110.00415.51
7.0.280.0060.00615.45
7.0.270.0050.00915.67
7.0.260.0040.00815.54
7.0.250.0080.00315.42
7.0.240.0030.01015.51
7.0.230.0100.00315.42
7.0.220.0080.00615.41
7.0.210.0030.00715.73
7.0.200.0030.00815.45
7.0.190.0080.00515.59
7.0.180.0030.00815.40
7.0.170.0080.00715.29
7.0.160.0050.00715.57
7.0.150.0070.00715.57
7.0.140.0060.02817.75
7.0.130.0060.00615.66
7.0.120.0050.00915.59
7.0.110.0070.00915.53
7.0.100.0030.01115.67
7.0.90.0080.00615.70
7.0.80.0030.00915.35
7.0.70.0050.01015.63
7.0.60.0090.02817.07
7.0.50.0090.03116.41
7.0.40.0080.01715.74
7.0.30.0100.02215.83
7.0.20.0180.02815.87
7.0.10.0020.03415.79
7.0.00.0030.03715.82
5.6.400.0040.01414.76
5.6.390.0030.01014.49
5.6.380.0070.00714.59
5.6.370.0090.00314.51
5.6.360.0030.00814.46
5.6.350.0020.01414.51
5.6.340.0060.00814.60
5.6.330.0130.00114.62
5.6.320.0060.01014.45
5.6.310.0030.00814.39
5.6.300.0080.00514.29
5.6.290.0030.01114.36
5.6.280.0050.02816.52
5.6.270.0050.01114.38
5.6.260.0080.00314.77
5.6.250.0040.00614.43
5.6.240.0060.00714.58
5.6.230.0040.01014.44
5.6.220.0030.01014.54
5.6.210.0040.02116.59
5.6.200.0090.03015.73
5.6.190.0060.02416.45
5.6.180.0120.02916.59
5.6.170.0140.02316.61
5.6.160.0080.03116.49
5.6.150.0110.02715.69
5.6.140.0070.03315.74
5.6.130.0080.03115.71
5.6.120.0020.03416.69
5.6.110.0060.01816.68
5.6.100.0060.03016.75
5.6.90.0050.02416.73
5.6.80.0060.02216.49
5.6.70.0060.00714.30
5.6.60.0050.00714.42
5.6.50.0050.00914.60
5.6.40.0050.00614.24
5.6.30.0090.00314.36
5.6.20.0060.00514.42
5.6.10.0060.00714.35
5.6.00.0050.00714.27
5.5.380.0030.00612.83
5.5.370.0030.01012.92
5.5.360.0070.00312.91
5.5.350.0050.02715.46
5.5.340.0060.03214.70
5.5.330.0030.03415.41
5.5.320.0140.02915.43
5.5.310.0110.03015.31
5.5.300.0070.03014.56
5.5.290.0050.02414.56
5.5.280.0080.02915.58
5.5.270.0050.03115.47
5.5.260.0050.02815.48
5.5.250.0100.02815.31
5.5.240.1410.01815.31
5.5.230.0060.00612.70
5.5.220.0010.00912.73
5.5.210.0050.00412.67
5.5.200.0080.00512.63
5.5.190.0040.01012.78
5.5.180.0050.00712.72
5.5.170.0050.00512.71
5.5.160.0020.00912.82
5.5.150.0070.00312.81
5.5.140.0050.00812.80
5.5.130.0020.00712.92
5.5.120.0080.00512.84
5.5.110.0070.00612.74
5.5.100.0050.00512.77
5.5.90.0020.01012.80
5.5.80.0060.00612.73
5.5.70.0050.00712.69
5.5.60.0040.00612.73
5.5.50.0030.00912.70
5.5.40.0060.00612.91
5.5.30.0040.00912.79
5.5.20.0000.01112.68
5.5.10.0030.00412.56
5.5.00.0070.00612.82
5.4.450.0130.01814.04
5.4.440.0110.01613.97
5.4.430.0200.01914.03
5.4.420.0180.02213.89
5.4.410.0050.01813.76
5.4.400.0100.01613.67
5.4.390.0090.01313.72
5.4.380.0070.02313.54
5.4.370.0070.02213.59
5.4.360.0080.02013.60
5.4.350.0060.02313.58
5.4.340.0050.02713.60
5.4.330.0090.00311.11
5.4.320.0060.01511.54
5.4.310.0060.01411.62
5.4.300.0070.01311.59
5.4.290.0060.02111.50
5.4.280.0030.01811.54
5.4.270.0060.01511.61
5.4.260.0040.02311.52
5.4.250.0090.01711.51
5.4.240.0050.01611.60
5.4.230.0060.01611.55
5.4.220.0080.01511.49
5.4.210.0070.01811.49
5.4.200.0040.01711.50
5.4.190.0060.01811.54
5.4.180.0060.01611.59
5.4.170.0080.01411.65
5.4.160.0030.01711.53
5.4.150.0040.01411.58
5.4.140.0040.01511.37
5.4.130.0030.01611.49
5.4.120.0040.01611.38
5.4.110.0020.01911.40
5.4.100.0050.01511.40
5.4.90.0050.01511.49
5.4.80.0050.01611.38
5.4.70.0040.01611.41
5.4.60.0090.02111.49
5.4.50.0060.01711.42
5.4.40.0050.01511.45
5.4.30.0060.01611.38
5.4.20.0030.01711.42
5.4.10.0040.01611.40
5.4.00.0040.01811.29
5.3.290.0060.02111.47
5.3.280.0070.01411.47
5.3.270.0030.01911.54
5.3.260.0030.01911.54
5.3.250.0030.01611.49
5.3.240.0040.01711.38
5.3.230.0040.01711.40
5.3.220.0050.01611.47
5.3.210.0060.01511.47
5.3.200.0040.01511.47
5.3.190.0030.01811.48
5.3.180.0040.02011.49
5.3.170.0050.02311.45
5.3.160.0060.01911.51
5.3.150.0060.01811.51
5.3.140.0050.01911.50
5.3.130.0030.01811.41
5.3.120.0030.01811.48
5.3.110.0110.01611.47
5.3.100.0030.01911.31
5.3.90.0050.01811.28
5.3.80.0070.01511.25
5.3.70.0060.01911.21
5.3.60.0040.02311.26
5.3.50.0040.02311.18
5.3.40.0070.02111.23
5.3.30.0050.02511.17
5.3.20.0040.02211.12
5.3.10.0020.02311.02
5.3.00.0040.02211.03
5.2.170.0060.02410.19
5.2.160.0050.02410.19
5.2.150.0070.02110.19
5.2.140.0050.02710.19
5.2.130.0060.02410.17
5.2.120.0030.02510.17
5.2.110.0040.02510.17
5.2.100.0060.02210.17
5.2.90.0030.02410.17
5.2.80.0060.02310.17
5.2.70.0020.02810.17
5.2.60.0040.02610.14
5.2.50.0040.02310.13
5.2.40.0090.02710.12
5.2.30.0030.02410.11
5.2.20.0030.02410.10
5.2.10.0030.02410.05
5.2.00.0040.0169.98
5.1.60.0030.0159.64
5.1.50.0060.0139.63
5.1.40.0030.0149.62
5.1.30.0040.0159.80
5.1.20.0050.0149.81
5.1.10.0030.0149.67
5.1.00.0040.0149.67
5.0.50.0040.0108.91
5.0.40.0040.0108.84
5.0.30.0030.0178.75
5.0.20.0030.0128.73
5.0.10.0020.0118.72
5.0.00.0040.0158.72
4.4.90.0020.0137.98
4.4.80.0020.0097.96
4.4.70.0040.0077.97
4.4.60.0030.0097.96
4.4.50.0040.0117.97
4.4.40.0030.0177.94
4.4.30.0020.0097.97
4.4.20.0020.0118.01
4.4.10.0020.0098.01
4.4.00.0040.0127.97
4.3.110.0030.0097.92
4.3.100.0040.0077.92
4.3.90.0030.0107.91
4.3.80.0050.0127.88
4.3.70.0020.0107.90
4.3.60.0030.0087.90
4.3.50.0010.0117.90
4.3.40.0040.0147.86
4.3.30.0020.0117.23
4.3.20.0030.0097.22
4.3.10.0020.0107.20
4.3.00.0070.00814.05

preferences:
46.53 ms | 401 KiB | 5 Q