3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arrayToUpper($array) { return mb_strtoupper($array[0], 'UTF-8'); } function arrayToLower($array) { return mb_strtolower($array[0], 'UTF-8'); } $address_l1 = 'Ul. Tadeusza Zawadzkiego "zośki" 59/11'; //zamieniamy znaki specjalne (tabulator, enter) na spację $first_upper = preg_replace('/([\n\r\t])/ui', ' ', trim($address_l1)); //ciąg więcej niż jedna spacja zamieniamy na jedną spację $first_upper = preg_replace('/([ ]{2,})/ui', ' ', $first_upper); //wycinamy spacje po kropkach... $first_upper = preg_replace('/(\.[ ]+)/ui', '.', $first_upper); //i wstawiamy po kropce zawsze jedną spację $first_upper = preg_replace('/(\.)/ui', '. ', $first_upper); //pierwsze litery wielkie $first_upper = mb_convert_case($first_upper, MB_CASE_TITLE, 'UTF-8'); //liczby rzymskie muszą być wszystkie wielkimi (bierzemy tylko pod uwagę liczby ze znakami I, V, X) $first_upper = preg_replace_callback('/([ \.]+[IVX-]{2,})/ui', 'arrayToUpper', " ".$first_upper); //po apostrofie mała litera $first_upper = preg_replace_callback('/([\'`].)/ui', 'arrayToLower', $first_upper); //po ukośniku duża litera litera $first_upper = preg_replace_callback('/([\/].)/ui', array(&$this, 'arrayToUpper'), $first_upper); //obcinamy spacje na początku i końcu $first_upper = trim($first_upper); var_dump($first_upper);

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.1.70.0040.00417.56
8.1.60.0000.00817.73
8.1.50.0030.00617.61
8.1.40.0060.00317.69
8.1.30.0060.00317.84
8.1.20.0000.00917.82
8.1.10.0060.00317.82
8.1.00.0030.00617.66
8.0.200.0070.00317.20
8.0.190.0030.00517.23
8.0.180.0040.00417.15
8.0.170.0080.00017.19
8.0.160.0070.00017.23
8.0.150.0030.00517.14
8.0.140.0030.00717.20
8.0.130.0000.00713.61
8.0.120.0000.01017.24
8.0.110.0000.00817.18
8.0.100.0000.00717.20
8.0.90.0080.00017.03
8.0.80.0090.00917.16
8.0.70.0040.00417.05
8.0.60.0070.00017.09
8.0.50.0000.00817.08
8.0.30.0090.00917.31
8.0.20.0080.01017.40
8.0.10.0040.00417.06
8.0.00.0110.01017.09
7.4.300.0060.00016.78
7.4.290.0000.00716.91
7.4.280.0050.00316.93
7.4.270.0070.00016.85
7.4.260.0030.00313.63
7.4.250.0040.00416.75
7.4.240.0070.00016.98
7.4.230.0030.00317.00
7.4.220.0100.00617.00
7.4.210.0080.01017.01
7.4.200.0020.00517.06
7.4.190.0040.00416.96
7.4.160.0040.01216.87
7.4.150.0110.00717.40
7.4.140.0070.01317.86
7.4.130.0090.00916.79
7.4.120.0120.00616.91
7.4.110.0120.00616.86
7.4.100.0110.01116.79
7.4.90.0040.01416.84
7.4.80.0110.00719.37
7.4.70.0120.00616.93
7.4.60.0080.01116.81
7.4.50.0090.00016.68
7.4.40.0090.00622.27
7.4.30.0090.01016.76
7.4.00.0030.01415.39
7.3.330.0000.00613.58
7.3.320.0000.00713.67
7.3.310.0050.00216.79
7.3.300.0020.00516.68
7.3.290.0080.00716.77
7.3.280.0100.00616.69
7.3.270.0110.00717.40
7.3.260.0140.01018.24
7.3.250.0050.01216.78
7.3.240.0140.00416.85
7.3.230.0050.01116.83
7.3.210.0070.01116.64
7.3.200.0100.00619.39
7.3.190.0120.00816.70
7.3.180.0060.00916.58
7.3.170.0030.01216.62
7.3.160.0110.00616.78
7.3.120.0030.01415.16
7.2.330.0060.01216.90
7.2.320.0070.01716.74
7.2.310.0110.00916.85
7.2.300.0130.01016.78
7.2.290.0100.00716.78
7.2.80.0030.00616.95
7.2.60.0100.00316.86
7.2.00.0040.00419.79
7.1.200.0060.00616.05
7.1.100.0000.01218.42
7.1.70.0030.00517.10
7.1.60.0070.01719.40
7.1.50.0330.01217.23
7.1.00.0100.06722.33
7.0.200.0070.00716.88
7.0.140.0100.06721.99
7.0.70.0100.08021.73
7.0.60.0130.07021.82
7.0.50.0030.08322.09
7.0.40.0070.08020.08
7.0.30.0070.08720.03
7.0.20.0030.06020.04
7.0.10.0030.07719.95
7.0.00.0030.06320.02
5.6.220.0000.05720.65
5.6.210.0070.06020.76
5.6.200.0030.09021.03
5.6.190.0030.09021.03
5.6.180.0070.08021.12
5.6.170.0000.08320.93
5.6.160.0100.05021.18
5.6.150.0030.05020.99
5.6.140.0130.07320.92
5.6.130.0030.08020.95
5.6.120.0000.06021.04
5.6.110.0070.05321.08
5.6.100.0130.07321.04
5.6.90.0030.08020.90
5.6.80.0030.08320.46
5.6.70.0000.08020.46
5.6.60.0130.03020.55
5.6.50.0030.08020.48
5.6.40.0070.08020.46
5.6.30.0030.05020.43
5.6.20.0100.05020.31
5.6.10.0030.08020.45
5.6.00.0100.07720.35
5.5.360.0030.08720.50
5.5.350.0030.08020.45
5.5.340.0000.08320.88
5.5.330.0030.08320.91
5.5.320.0000.09020.77
5.5.310.0000.06320.84
5.5.300.0030.08320.92
5.5.290.0000.08320.82
5.5.280.0000.06320.87
5.5.270.0000.08320.80
5.5.260.0100.07720.90
5.5.250.0000.09020.54
5.5.240.0070.07320.19
5.5.230.0000.08020.19
5.5.220.0000.07720.18
5.5.210.0070.06020.11
5.5.200.0030.08020.20
5.5.190.0070.05320.29
5.5.180.0100.07320.25
5.5.160.0000.07020.11
5.5.150.0070.06320.28
5.5.140.0000.08320.16
5.5.130.0130.06720.07
5.5.120.0070.05020.08
5.5.110.0030.05720.11
5.5.100.0030.07319.96
5.5.90.0000.08320.09
5.5.80.0000.06020.10
5.5.70.0000.08720.14
5.5.60.0000.06719.93
5.5.50.0030.04720.09
5.5.40.0030.04719.98
5.5.30.0000.07720.03
5.5.20.0070.08019.99
5.5.10.0030.08020.06
5.5.00.0030.07320.00
5.4.450.0000.08719.46
5.4.440.0100.04719.36
5.4.430.0070.05019.55
5.4.420.0100.07719.46
5.4.410.0070.07719.24
5.4.400.0030.07019.00
5.4.390.0100.07318.90
5.4.380.0000.04318.88
5.4.370.0070.05019.18
5.4.360.0130.06019.09
5.4.350.0030.05718.95
5.4.340.0070.07719.13
5.4.320.0030.07018.85
5.4.310.0100.07319.21
5.4.300.0100.04718.94
5.4.290.0070.04719.20
5.4.280.0030.05719.09
5.4.270.0000.04719.16
5.4.260.0030.06319.16
5.4.250.0000.08319.04
5.4.240.0100.06719.04
5.4.230.0030.06319.10
5.4.220.0030.04319.02
5.4.210.0030.05018.84
5.4.200.0070.04719.15
5.4.190.0000.06019.07
5.4.180.0030.07719.17
5.4.170.0000.05719.04
5.4.160.0030.04319.01
5.4.150.0130.04718.82
5.4.140.0030.07716.48
5.4.130.0030.07316.47
5.4.120.0030.07016.50
5.4.110.0100.06716.39
5.4.100.0100.06716.41
5.4.90.0000.05016.41
5.4.80.0000.07716.43
5.4.70.0070.07016.54
5.4.60.0070.07016.31
5.4.50.0100.06716.36
5.4.40.0070.07016.49
5.4.30.0070.04016.32
5.4.20.0100.05316.36
5.4.10.0030.07716.36
5.4.00.0030.06015.63
5.3.290.0070.07714.57
5.3.280.0000.08314.71
5.3.270.0030.08714.66
5.3.260.0000.08314.66
5.3.250.0000.08014.64
5.3.240.0030.07314.73
5.3.230.0030.07014.59
5.3.220.0000.08014.56
5.3.210.0000.07314.60
5.3.200.0030.06014.64
5.3.190.0100.07314.68
5.3.180.0070.06714.59
5.3.170.0070.06714.56
5.3.160.0000.06314.56
5.3.150.0030.07014.57
5.3.140.0100.07314.53
5.3.130.0100.06714.48
5.3.120.0030.08014.48
5.3.110.0100.07314.59
5.3.100.0030.06314.14
5.3.90.0000.07314.01
5.3.80.0030.08014.16
5.3.70.0100.06013.93
5.3.60.0100.06314.09
5.3.50.0030.07314.09
5.3.40.0030.06014.05
5.3.30.0000.05714.03
5.3.20.0030.06013.61
5.3.10.0030.03313.71
5.3.00.0030.04013.69
5.2.170.0030.04012.23
5.2.160.0000.05712.23
5.2.150.0030.06312.23
5.2.140.0070.06312.23
5.2.130.0000.06312.23
5.2.120.0000.04312.23
5.2.110.0030.05712.23
5.2.100.0030.06012.23
5.2.90.0070.06012.23
5.2.80.0030.06012.23
5.2.70.0030.04312.23
5.2.60.0030.04012.23
5.2.50.0030.06712.23
5.2.40.0030.06012.23
5.2.30.0100.06012.23
5.2.20.0070.05312.23
5.2.10.0030.05312.23
5.2.00.0000.05712.23
5.1.60.0070.04712.23
5.1.50.0000.05712.23
5.1.40.0030.05712.23
5.1.30.0070.05012.23
5.1.20.0030.05312.23
5.1.10.0000.05312.23
5.1.00.0000.05712.23
5.0.50.0030.04312.23
5.0.40.0000.04312.23
5.0.30.0070.06012.23
5.0.20.0030.04312.23
5.0.10.0030.04312.23
5.0.00.0070.05712.23
4.4.90.0030.03312.23
4.4.80.0030.03312.23
4.4.70.0000.02712.23
4.4.60.0000.03712.23
4.4.50.0000.03312.23
4.4.40.0000.04312.23
4.4.30.0000.03712.23
4.4.20.0030.03712.23
4.4.10.0000.03012.23
4.4.00.0030.05312.23
4.3.110.0030.03312.23
4.3.100.0000.02312.23
4.3.90.0030.02712.23
4.3.80.0030.03712.23
4.3.70.0030.03012.23
4.3.60.0000.03712.23
4.3.50.0000.03012.23
4.3.40.0000.05712.23
4.3.30.0000.03712.23
4.3.20.0030.03012.23
4.3.10.0000.03012.23
4.3.00.0070.02312.23

preferences:
11.1 ms | 406 KiB | 5 Q