3v4l.org

run code in 300+ PHP versions simultaneously
<?php function smart_uc_words($string) { $string = strtolower(trim($string)); // Capitalise any word char preceded by a non-word char other than an apostrophe $string = preg_replace_callback('/(?<!\w|\')(\w)/', function($m){ return strtoupper($m[1]); }, $string); // Capitalise any word char which comes between an apostrophe and another word char $string = preg_replace_callback('/(?<=\')(\w)(?=\w)/', function($m){ return strtoupper($m[1]); }, $string); return $string; } echo smart_uc_words("O'BRIEN'S BAR NO.FOUR");

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.0180.00016.88
8.3.50.0050.01322.20
8.3.40.0060.00818.92
8.3.30.0160.00018.86
8.3.20.0060.00320.20
8.3.10.0000.00823.64
8.3.00.0040.00420.80
8.2.180.0120.00316.50
8.2.170.0120.00622.96
8.2.160.0110.00420.35
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00520.87
8.2.110.0070.00322.38
8.2.100.0060.00617.91
8.2.90.0000.00719.29
8.2.80.0000.00817.97
8.2.70.0000.00817.73
8.2.60.0000.01218.05
8.2.50.0000.00818.07
8.2.40.0030.00521.30
8.2.30.0000.00818.36
8.2.20.0080.00017.83
8.2.10.0040.00318.06
8.2.00.0000.00717.81
8.1.280.0180.00025.92
8.1.270.0040.00423.64
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00322.14
8.1.230.0080.00419.08
8.1.220.0090.00017.77
8.1.210.0000.00818.77
8.1.200.0090.00017.47
8.1.190.0080.00017.48
8.1.180.0000.00818.10
8.1.170.0000.00818.66
8.1.160.0040.00422.09
8.1.150.0050.00218.74
8.1.140.0050.00217.48
8.1.130.0000.00717.80
8.1.120.0000.00817.52
8.1.110.0000.00717.63
8.1.100.0000.00717.55
8.1.90.0080.00017.69
8.1.80.0030.00517.50
8.1.70.0000.00717.51
8.1.60.0030.00617.76
8.1.50.0000.00917.72
8.1.40.0000.00817.68
8.1.30.0000.00817.68
8.1.20.0000.00717.84
8.1.10.0000.00917.64
8.1.00.0000.00817.56
8.0.300.0040.00418.77
8.0.290.0070.00017.05
8.0.280.0000.00718.55
8.0.270.0030.00617.28
8.0.260.0040.00417.32
8.0.250.0000.00817.02
8.0.240.0040.00417.01
8.0.230.0070.00016.99
8.0.220.0050.00216.88
8.0.210.0030.00316.86
8.0.200.0030.00317.06
8.0.190.0070.00017.01
8.0.180.0040.00417.09
8.0.170.0000.00717.11
8.0.160.0000.00716.92
8.0.150.0040.00417.00
8.0.140.0040.00417.04
8.0.130.0000.00513.40
8.0.120.0080.00017.00
8.0.110.0000.00717.11
8.0.100.0070.00017.11
8.0.90.0040.00416.94
8.0.80.0120.00616.95
8.0.70.0080.00016.93
8.0.60.0000.00717.09
8.0.50.0080.00017.01
8.0.30.0070.01117.33
8.0.20.0110.00817.57
8.0.10.0000.00717.15
8.0.00.0100.00816.91
7.4.330.0050.00015.11
7.4.320.0000.00616.84
7.4.300.0030.00316.71
7.4.290.0080.00016.82
7.4.280.0040.00416.65
7.4.270.0000.00716.79
7.4.260.0040.00716.74
7.4.250.0030.00516.82
7.4.240.0030.00416.77
7.4.230.0040.00416.82
7.4.220.0100.00716.70
7.4.210.0090.00616.77
7.4.200.0000.00716.93
7.4.190.0030.00516.67
7.4.160.0140.00316.62
7.4.150.0110.00717.40
7.4.140.0110.01517.86
7.4.130.0080.01016.70
7.4.120.0060.01116.74
7.4.110.0140.00316.79
7.4.100.0120.00616.45
7.4.90.0120.00916.79
7.4.80.0050.01419.39
7.4.70.0080.00816.56
7.4.60.0150.00316.71
7.4.50.0040.00416.59
7.4.40.0090.01016.69
7.4.30.0030.01316.84
7.4.00.0080.01014.89
7.3.330.0030.00313.45
7.3.320.0050.00013.43
7.3.310.0030.00516.51
7.3.300.0040.00416.46
7.3.290.0130.00316.41
7.3.280.0090.01016.40
7.3.270.0190.00017.40
7.3.260.0060.01516.55
7.3.250.0080.01016.72
7.3.240.0060.01216.38
7.3.230.0100.00616.57
7.3.210.0120.00816.69
7.3.200.0000.01619.39
7.3.190.0000.01916.38
7.3.180.0100.00616.51
7.3.170.0030.01316.70
7.3.160.0080.00816.42
7.3.120.0030.01314.99
7.3.110.0070.01014.90
7.3.100.0070.00714.95
7.3.90.0100.00314.88
7.3.80.0110.00315.16
7.3.70.0050.00515.03
7.3.60.0100.00615.01
7.3.50.0060.00614.81
7.3.40.0060.00615.01
7.3.30.0040.00814.78
7.3.20.0060.00616.59
7.3.10.0040.01116.73
7.3.00.0000.00916.84
7.2.330.0060.01216.79
7.2.320.0190.00016.78
7.2.310.0150.00916.77
7.2.300.0080.00816.92
7.2.290.0210.00316.73
7.2.250.0140.00315.12
7.2.240.0070.01315.17
7.2.230.0070.00415.00
7.2.220.0100.00315.44
7.2.210.0040.01115.36
7.2.200.0040.01114.82
7.2.190.0030.00715.20
7.2.180.0030.01415.16
7.2.170.0070.00715.21
7.2.00.0100.00719.70
7.1.330.0110.00315.75
7.1.320.0100.00615.99
7.1.310.0030.01216.09
7.1.300.0070.00315.91
7.1.290.0030.00616.02
7.1.280.0030.01016.02
7.1.270.0060.00915.79
7.1.260.0070.00315.87
7.1.100.0000.01018.44
7.1.70.0000.00917.58
7.1.60.0030.02119.46
7.1.50.0040.01817.16
7.1.00.0030.07722.32
7.0.200.0040.00716.68
7.0.140.0100.06722.09
7.0.60.0130.05719.86
7.0.50.0100.07717.90
7.0.40.0130.08020.32
7.0.30.0430.05020.26
7.0.20.0130.04720.32
7.0.10.0230.06720.07
7.0.00.0030.07020.27
5.6.210.0130.07320.67
5.6.200.0070.08318.20
5.6.190.0000.05320.78
5.6.180.3700.04320.44
5.6.170.0270.07720.57
5.6.160.0170.07320.39
5.6.150.0100.07718.29
5.6.140.0130.04718.15
5.6.130.0000.09318.12
5.6.120.0030.06321.04
5.6.110.0070.08020.98
5.6.100.0100.08020.99
5.6.90.0100.08021.05
5.6.80.0030.04320.39
5.6.70.0130.08720.39
5.5.350.0130.07720.39
5.5.340.0030.04317.98
5.5.330.0070.04020.32
5.5.320.0270.07720.43
5.5.310.0270.07320.34
5.5.300.0070.06318.04
5.5.290.0030.05317.95
5.5.280.0030.08720.88
5.5.270.0070.08320.80
5.5.260.0070.04720.88
5.5.250.0030.07320.70
5.5.240.0100.07020.19
5.4.450.0730.05719.62
5.4.440.0770.06019.34
5.4.430.0700.05019.47
5.4.420.0670.00019.37
5.4.410.0200.06019.01
5.4.400.0230.07318.66
5.4.390.0070.06718.54
5.4.380.0330.04718.75
5.4.370.0170.03718.50
5.4.360.0100.04318.62
5.4.350.0040.03712.03
5.4.340.0060.03912.03
5.4.320.0050.03712.52
5.4.310.0060.03812.51
5.4.300.0100.03512.51
5.4.290.0050.04012.51
5.4.280.0060.03712.41
5.4.270.0070.03612.41
5.4.260.0040.04212.40
5.4.250.0050.03912.41
5.4.240.0090.03512.40
5.4.230.0030.04212.40
5.4.220.0070.04112.40
5.4.210.0070.05212.40
5.4.200.0100.05212.40
5.4.190.0080.05212.39
5.4.180.0030.05912.39
5.4.170.0110.05112.40
5.4.160.0070.05212.40
5.4.150.0090.05012.39
5.4.140.0090.05212.08
5.4.130.0040.04712.07
5.4.120.0070.03512.03
5.4.110.0070.03412.02
5.4.100.0060.03512.02
5.4.90.0070.03612.02
5.4.80.0050.03812.02
5.4.70.0060.03512.02
5.4.60.0050.03612.02
5.4.50.0080.03412.02
5.4.40.0050.03712.00
5.4.30.0070.03612.00
5.4.20.0100.03312.00
5.4.10.0040.03812.00
5.4.00.0050.03711.49
5.3.290.0070.05412.80
5.3.280.0070.03812.71
5.3.270.0070.03912.72
5.3.260.0070.04012.72
5.3.250.0070.03712.72
5.3.240.0080.03612.71
5.3.230.0040.04012.71
5.3.220.0100.03812.68
5.3.210.0050.04012.68
5.3.200.0070.03612.68
5.3.190.0070.04212.68
5.3.180.0080.03512.68
5.3.170.0080.03512.67
5.3.160.0050.04012.68
5.3.150.0080.04612.67
5.3.140.0110.03212.66
5.3.130.0070.04112.66
5.3.120.0060.04012.66
5.3.110.0060.04012.66
5.3.100.0060.04512.12
5.3.90.0050.04112.11
5.3.80.0030.04012.10
5.3.70.0060.03712.10
5.3.60.0040.03912.09
5.3.50.0040.03812.04
5.3.40.0070.03612.04
5.3.30.0060.03611.99
5.3.20.0060.03511.78
5.3.10.0080.03311.74
5.3.00.0040.03811.73
5.2.170.0060.0309.21
5.2.160.0040.0369.22
5.2.150.0040.0429.21
5.2.140.0060.0409.21
5.2.130.0070.0419.18
5.2.120.0060.0419.17
5.2.110.0080.0389.18
5.2.100.0060.0409.18
5.2.90.0060.0409.18
5.2.80.0060.0349.17
5.2.70.0040.0349.17
5.2.60.0060.0379.13
5.2.50.0080.0399.09
5.2.40.0030.0369.07
5.2.30.0060.0319.05
5.2.20.0050.0359.04
5.2.10.0090.0248.95
5.2.00.0070.0338.81
5.1.60.0080.0318.09
5.1.50.0060.0238.09
5.1.40.0050.0318.06
5.1.30.0060.0368.42
5.1.20.0070.0318.44
5.1.10.0030.0288.16
5.1.00.0040.0258.16
5.0.50.0070.0176.64
5.0.40.0030.0216.51
5.0.30.0040.0326.31
5.0.20.0030.0216.29
5.0.10.0040.0196.27
5.0.00.0020.0326.25
4.4.90.0060.0124.78
4.4.80.0040.0144.75
4.4.70.0020.0164.75
4.4.60.0050.0134.75
4.4.50.0040.0134.77
4.4.40.0020.0254.71
4.4.30.0040.0144.76
4.4.20.0030.0154.84
4.4.10.0020.0164.85
4.4.00.0040.0274.76
4.3.110.0040.0204.66
4.3.100.0030.0204.66
4.3.90.0060.0164.63
4.3.80.0040.0284.59
4.3.70.0010.0214.63
4.3.60.0030.0164.63
4.3.50.0040.0174.63
4.3.40.0050.0264.54
4.3.30.0000.0193.30
4.3.20.0040.0213.27
4.3.10.0030.0203.24
4.3.00.0130.0237.62

preferences:
35.3 ms | 401 KiB | 5 Q