3v4l.org

run code in 300+ PHP versions simultaneously
<?php function titleCase($string) { $len=strlen($string); $i=0; $last= ""; $new= ""; $string=strtoupper($string); while ($i<$len): $char=substr($string,$i,1); if (ereg( "[A-Z]",$last)): $new.=strtolower($char); else: $new.=strtoupper($char); endif; $last=$char; $i++; endwhile; return($new); }; echo titleCase("hello there, world!"); ?>

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.0030.01316.50
8.3.50.0180.01122.89
8.3.40.0070.00718.67
8.3.30.0180.00319.22
8.3.20.0060.00920.10
8.3.10.0040.00423.53
8.3.00.0040.01219.38
8.2.180.0120.00316.72
8.2.170.0070.00722.96
8.2.160.0130.00020.52
8.2.150.0110.00724.18
8.2.140.0050.00324.66
8.2.130.0100.00326.16
8.2.120.0040.00421.05
8.2.110.0150.00322.43
8.2.100.0040.00717.72
8.2.90.0000.00817.91
8.2.80.0030.00619.36
8.2.70.0080.00017.80
8.2.60.0030.00617.93
8.2.50.0080.00018.10
8.2.40.0050.00320.61
8.2.30.0000.00718.05
8.2.20.0000.00817.74
8.2.10.0040.00418.12
8.2.00.0040.00417.74
8.1.280.0140.00325.92
8.1.270.0030.00523.87
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0140.00722.19
8.1.230.0090.00322.32
8.1.220.0000.00717.74
8.1.210.0030.00618.77
8.1.200.0040.00417.22
8.1.190.0030.00517.23
8.1.180.0000.00818.10
8.1.170.0030.00518.52
8.1.160.0040.00422.04
8.1.150.0030.00618.82
8.1.140.0070.00017.30
8.1.130.0030.00317.89
8.1.120.0040.00417.29
8.1.110.0040.00417.37
8.1.100.0040.00417.36
8.1.90.0030.00517.29
8.1.80.0050.00217.38
8.1.70.0000.00717.28
8.1.60.0050.00317.56
8.1.50.0030.00517.51
8.1.40.0000.00717.44
8.1.30.0040.00417.62
8.1.20.0060.00317.63
8.1.10.0040.00417.45
8.1.00.0040.00417.36
8.0.300.0060.00319.95
8.0.290.0000.00716.75
8.0.280.0000.00718.41
8.0.270.0030.00317.13
8.0.260.0030.00317.21
8.0.250.0000.00716.95
8.0.240.0000.00716.96
8.0.230.0030.00316.89
8.0.220.0040.00416.86
8.0.210.0030.00616.82
8.0.200.0000.00716.95
8.0.190.0040.00416.93
8.0.180.0000.00716.94
8.0.170.0050.00216.91
8.0.160.0000.00716.94
8.0.150.0000.00816.88
8.0.140.0040.00416.76
8.0.130.0060.00313.26
8.0.120.0080.00016.77
8.0.110.0060.00316.80
8.0.100.0080.00017.00
8.0.90.0040.00416.91
8.0.80.0120.00616.88
8.0.70.0040.00416.91
8.0.60.0000.00716.87
8.0.50.0000.00816.85
8.0.30.0160.00517.34
8.0.20.0130.00817.40
8.0.10.0000.00816.89
8.0.00.0070.01216.76
7.4.330.0030.00315.00
7.4.320.0060.00016.45
7.4.300.0060.00016.63
7.4.290.0000.00916.51
7.4.280.0000.00816.49
7.4.270.0000.00716.53
7.4.260.0030.00316.54
7.4.250.0000.00716.51
7.4.240.0040.00416.53
7.4.230.0030.00316.60
7.4.220.0030.01416.46
7.4.210.0090.00616.46
7.4.200.0070.00016.68
7.4.160.0030.01316.69
7.4.150.0090.00917.40
7.4.140.0100.00817.86
7.4.130.0080.00916.50
7.4.120.0080.01016.52
7.4.110.0130.00316.62
7.4.100.0070.01016.62
7.4.90.0120.00616.44
7.4.80.0120.00619.39
7.4.70.0140.00316.38
7.4.60.0070.01316.64
7.4.50.0000.00416.43
7.4.40.0140.00416.47
7.4.30.0140.00916.48
7.4.10.0040.01515.07
7.4.00.0090.00715.01
7.3.330.0000.00613.36
7.3.320.0000.00513.45
7.3.310.0000.00716.48
7.3.300.0000.00816.34
7.3.290.0100.01016.43
7.3.280.0050.01116.38
7.3.270.0070.01017.40
7.3.260.0170.00716.36
7.3.250.0120.00816.33
7.3.240.0100.00616.43
7.3.230.0110.00516.39
7.3.210.0100.00716.40
7.3.200.0090.00919.39
7.3.190.0070.01316.31
7.3.180.0060.01316.40
7.3.170.0180.00416.36
7.3.160.0060.00916.41
7.3.130.0070.01014.90
7.3.120.0000.01814.85
7.3.110.0070.01414.87
7.3.100.0060.01214.96
7.3.90.0110.00714.90
7.3.80.0040.00814.92
7.3.70.0070.01014.77
7.3.60.0090.00314.67
7.3.50.0060.00614.93
7.3.40.0000.01614.66
7.3.30.0090.00014.58
7.3.20.0060.00616.72
7.3.10.0090.00516.71
7.3.00.0080.00516.49
7.2.330.0100.01416.46
7.2.320.0130.00916.54
7.2.310.0120.00916.40
7.2.300.0030.01416.59
7.2.290.0070.01016.46
7.2.260.0060.01314.89
7.2.250.0110.00714.88
7.2.240.0030.01314.78
7.2.230.0000.01714.92
7.2.220.0110.00715.13
7.2.210.0100.00314.88
7.2.200.0060.00914.91
7.2.190.0070.00714.81
7.2.180.0060.00614.81
7.2.170.0060.01014.81
7.2.160.0040.00814.98
7.2.150.0070.00716.59
7.2.140.0000.01216.85
7.2.130.0070.00516.76
7.2.120.0030.01016.75
7.2.110.0040.01016.88
7.2.100.0090.00416.79
7.2.90.0090.00716.95
7.2.80.0080.00916.81
7.2.70.0070.00316.94
7.2.60.0040.01016.86
7.2.50.0070.00716.89
7.2.40.0080.00716.81
7.2.30.0060.00816.91
7.2.20.0070.00716.80
7.2.10.0030.00816.68
7.2.00.0070.00817.52
7.1.330.0030.00915.61
7.1.320.0040.00815.90
7.1.310.0090.00615.71
7.1.300.0000.01015.48
7.1.290.0060.00615.92
7.1.280.0040.00815.82
7.1.270.0000.01315.83
7.1.260.0060.00315.95
7.1.250.0050.00415.74
7.1.240.0070.00716.04
7.1.230.0060.00715.67
7.1.220.0100.00315.89
7.1.210.0120.00316.00
7.1.200.0070.00615.71
7.1.190.0070.00315.55
7.1.180.0050.00315.78
7.1.170.0040.00415.49
7.1.160.0000.01415.84
7.1.150.0080.00815.54
7.1.140.0040.00715.89
7.1.130.0030.00715.58
7.1.120.0110.00415.61
7.1.110.0030.01015.91
7.1.100.0070.00717.00
7.1.90.0100.00015.75
7.1.80.0030.01015.97
7.1.70.0050.00516.38
7.1.60.0080.01317.70
7.1.50.0070.01216.33
7.1.40.0100.00715.71
7.1.30.0000.01015.71
7.1.20.0030.00915.94
7.1.10.0060.00915.91
7.1.00.0070.04018.96
7.0.330.0060.00715.60
7.0.320.0080.00015.32
7.0.310.0000.00815.17
7.0.300.0060.00615.41
7.0.290.0080.00315.30
7.0.280.0000.01015.24
7.0.270.0100.00315.65
7.0.260.0100.00315.46
7.0.250.0040.00415.30
7.0.240.0040.00815.46
7.0.230.0000.01515.68
7.0.220.0030.00715.54
7.0.210.0030.00615.40
7.0.200.0040.00516.02
7.0.190.0040.00715.38
7.0.180.0000.01215.53
7.0.170.0120.00015.34
7.0.160.0040.01115.44
7.0.150.0060.00615.45
7.0.140.0000.04318.82
7.0.130.0030.01315.46
7.0.120.0000.01415.57
7.0.110.0030.01015.44
7.0.100.0070.00415.52
7.0.90.0030.00615.45
7.0.80.0060.00315.35
7.0.70.0040.01115.17
7.0.60.0070.04417.67
7.0.50.0020.03516.72
7.0.40.0070.02716.64
7.0.30.0250.04716.78
7.0.20.0170.03716.81
7.0.10.0080.04416.68
7.0.00.0010.02916.86
5.6.400.0060.00614.53
5.6.390.0000.01314.59
5.6.380.0070.01013.90
5.6.370.0000.00914.74
5.6.360.0000.01214.73
5.6.350.0080.00614.84
5.6.340.0080.00414.27
5.6.330.0030.01214.74
5.6.320.0000.00814.23
5.6.310.0030.00614.32
5.6.300.0030.00614.25
5.6.290.0030.01014.65
5.6.280.0020.04017.45
5.6.270.0000.01614.11
5.6.260.0000.00914.39
5.6.250.0040.00414.51
5.6.240.0060.00914.34
5.6.230.0090.00314.33
5.6.220.0060.00614.34
5.6.210.0050.03417.45
5.6.200.0060.04016.19
5.6.190.0030.02717.51
5.6.180.0160.04117.57
5.6.170.0160.01817.35
5.6.160.0070.04517.60
5.6.150.0030.04816.27
5.6.140.0100.03816.23
5.6.130.0070.03116.22
5.6.120.0100.03217.58
5.6.110.0050.04217.80
5.6.100.0050.04817.64
5.6.90.0100.03417.69
5.6.80.0030.03117.28
5.6.70.0120.00014.24
5.6.60.0040.00814.02
5.6.50.0060.00613.96
5.6.40.0030.00614.24
5.6.30.0040.00813.97
5.6.20.0110.00314.45
5.6.10.0040.01114.05
5.6.00.0070.00714.27
5.5.380.0170.00014.54
5.5.370.0030.01014.27
5.5.360.0110.00314.53
5.5.350.0070.03217.23
5.5.340.0080.04315.97
5.5.330.0070.02217.40
5.5.320.0080.02817.36
5.5.310.0220.02517.36
5.5.300.0070.03216.05
5.5.290.0070.04316.30
5.5.280.0070.04617.59
5.5.270.0080.03617.46
5.5.260.0050.03917.32
5.5.250.0120.04017.38
5.5.240.0210.03617.11
5.5.230.0070.00314.21
5.5.220.0080.00614.30
5.5.210.0090.00614.45
5.5.200.0070.00714.02
5.5.190.0070.00414.26
5.5.180.0060.00314.18
5.5.170.0000.01314.46
5.5.160.0070.00713.92
5.5.150.0000.01514.30
5.5.140.0060.00914.13
5.5.130.0040.00814.07
5.5.120.0080.00613.85
5.5.110.0070.00714.06
5.5.100.0050.00514.20
5.5.90.0000.01214.10
5.5.80.0080.00414.13
5.5.70.0040.01214.27
5.5.60.0070.00714.31
5.5.50.0050.00514.38
5.5.40.0070.00314.04
5.5.30.0100.00314.46
5.5.20.0060.00914.12
5.5.10.0040.01114.30
5.5.00.0060.00314.27
5.4.450.0080.04015.28
5.4.440.0050.04015.24
5.4.430.0040.02515.19
5.4.420.0050.04015.14
5.4.410.0030.02715.17
5.4.400.0050.03615.24
5.4.390.0030.03115.15
5.4.380.0060.02015.01
5.4.370.0030.03914.99
5.4.360.0050.03715.08
5.4.350.0020.04415.12
5.4.340.0020.03314.95
5.4.330.0000.01110.77
5.4.320.0070.03515.27
5.4.310.0030.03015.19
5.4.300.0030.04215.17
5.4.290.0020.04215.21
5.4.280.0020.04015.18
5.4.270.0000.02614.95
5.4.260.0120.03514.87
5.4.250.0020.04215.11
5.4.240.0020.04215.08
5.4.230.0050.03515.10
5.4.220.0040.03914.97
5.4.210.0060.04014.94
5.4.200.0050.02714.97
5.4.190.0030.02614.89
5.4.180.0030.02114.79
5.4.170.0040.02014.79
5.4.160.0070.01815.15
5.4.150.0050.02014.98
5.4.140.0000.02213.74
5.4.130.0030.01813.72
5.4.120.0000.02013.76
5.4.110.0020.02513.88
5.4.100.0020.02613.60
5.4.90.0020.02513.83
5.4.80.0050.01813.59
5.4.70.0030.01713.79
5.4.60.0020.01813.74
5.4.50.0050.02013.74
5.4.40.0050.01813.83
5.4.30.0020.01913.82
5.4.20.0040.02213.58
5.4.10.0020.02113.51
5.4.00.0000.02313.47
5.3.290.0030.05314.68
5.3.280.0030.06014.51
5.3.270.0000.04014.77
5.3.260.0000.03714.59
5.3.250.0000.03714.61
5.3.240.0000.03714.57
5.3.230.0000.03714.50
5.3.220.0000.03714.64
5.3.210.0030.03314.48
5.3.200.0070.03014.46
5.3.190.0000.03714.68
5.3.180.0000.03714.61
5.3.170.0000.03714.58
5.3.160.0000.03714.61
5.3.150.0030.04014.72
5.3.140.0000.03714.66
5.3.130.0000.04314.55
5.3.120.0000.03714.44
5.3.110.0000.04014.71
5.3.100.0000.04314.43
5.3.90.0000.03314.43
5.3.80.0000.04314.43
5.3.70.0000.03714.43
5.3.60.0000.03714.43
5.3.50.0000.03714.43
5.3.40.0000.04314.43
5.3.30.0030.03714.43
5.3.20.0000.03314.43
5.3.10.0000.03314.43
5.3.00.0000.03314.43
5.2.170.0000.03314.43
5.2.160.0000.02714.43
5.2.150.0000.03014.43
5.2.140.0000.03014.43
5.2.130.0030.02714.43
5.2.120.0000.03014.43
5.2.110.0000.02714.43
5.2.100.0070.02314.43
5.2.90.0000.02714.43
5.2.80.0000.03014.43
5.2.70.0000.03014.43
5.2.60.0030.02714.43
5.2.50.0030.02714.43
5.2.40.0070.02714.43
5.2.30.0000.03014.43
5.2.20.0000.03014.43
5.2.10.0000.05314.43
5.2.00.0000.04014.43
5.1.60.0100.02714.43
5.1.50.0030.02714.43
5.1.40.0030.02714.43
5.1.30.0000.05714.43
5.1.20.0030.04314.43
5.1.10.0000.05714.43
5.1.00.0000.05014.43
5.0.50.0000.04714.43
5.0.40.0100.03714.43
5.0.30.0070.06014.43
5.0.20.0070.03014.43
5.0.10.0030.03714.43
5.0.00.0000.06314.43
4.4.90.0030.01314.43
4.4.80.0030.01314.43
4.4.70.0000.01314.43
4.4.60.0030.02314.43
4.4.50.0030.02314.43
4.4.40.0030.05014.43
4.4.30.0000.01714.43
4.4.20.0000.03714.43
4.4.10.0030.02714.43
4.4.00.0030.04314.43
4.3.110.0000.03714.43
4.3.100.0000.02314.43
4.3.90.0030.03014.43
4.3.80.0070.04714.43
4.3.70.0000.03714.43
4.3.60.0000.03314.43
4.3.50.0000.04014.43
4.3.40.0030.04714.43
4.3.30.0000.02014.43
4.3.20.0030.03714.43
4.3.10.0070.02314.43
4.3.00.0030.03014.43

preferences:
34.88 ms | 401 KiB | 5 Q