3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* function clean_string($string) { $parts = preg_split('/\s+/', $string); $partsCount = count($parts); for ($i = 0; $i < $partsCount; $i++) { if ($parts[$i] === strtoupper($parts[$i])) { $parts[$i] = ucfirst(strtolower($parts[$i])); } } return implode(' ', $parts); } */ //or shorter:) function cleanString($string){ return array_reduce(preg_split('/\s+/', $string), function ($carry, $item){ return $carry . ' '. (($item === strtoupper($item)) ? ucfirst(strtolower($item)) : $item); }); } echo cleanString('INTERVIEW – Jo Stenuit, Belgisch designdirecteur Mazda Motor Europe');

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.0070.00720.29
8.3.50.0030.01218.11
8.3.40.0080.00818.76
8.3.30.0040.01218.82
8.3.20.0070.01021.96
8.3.10.0050.00323.48
8.3.00.0000.00821.91
8.2.180.0120.00318.54
8.2.170.0080.00822.96
8.2.160.0100.01019.26
8.2.150.0050.00324.18
8.2.140.0030.01324.66
8.2.130.0080.00017.97
8.2.120.0070.01026.35
8.2.110.0100.00020.96
8.2.100.0120.00018.09
8.2.90.0040.00417.99
8.2.80.0000.00917.97
8.2.70.0040.00417.80
8.2.60.0110.00017.95
8.2.50.0060.00318.10
8.2.40.0000.00921.20
8.2.30.0000.00719.35
8.2.20.0000.00818.16
8.2.10.0050.00320.58
8.2.00.0000.00719.46
8.1.280.0110.00725.92
8.1.270.0060.00318.82
8.1.260.0070.00026.35
8.1.250.0070.00728.09
8.1.240.0090.00417.64
8.1.230.0110.00020.89
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0000.00817.38
8.1.180.0060.00318.10
8.1.170.0030.00518.60
8.1.160.0000.00718.86
8.1.150.0040.00418.87
8.1.140.0000.00722.09
8.1.130.0000.00717.55
8.1.120.0070.00417.48
8.1.110.0000.00717.60
8.1.100.0000.00717.58
8.1.90.0040.00417.54
8.1.80.0000.00917.64
8.1.70.0000.00717.53
8.1.60.0000.00817.71
8.1.50.0050.00317.46
8.1.40.0060.00317.64
8.1.30.0070.00317.63
8.1.20.0000.00817.71
8.1.10.0040.00417.64
8.1.00.0040.00417.48
8.0.300.0040.00419.78
8.0.290.0070.00416.63
8.0.280.0030.00318.41
8.0.270.0030.00317.22
8.0.260.0070.00017.02
8.0.250.0000.00816.95
8.0.240.0040.00416.93
8.0.230.0070.00017.10
8.0.220.0030.00316.94
8.0.210.0000.00817.02
8.0.200.0060.00016.92
8.0.190.0050.00316.91
8.0.180.0030.00516.91
8.0.170.0090.00016.89
8.0.160.0050.00317.00
8.0.150.0000.00816.87
8.0.140.0080.00016.93
8.0.130.0020.00513.34
8.0.120.0040.00417.01
8.0.110.0000.00817.02
8.0.100.0000.00717.02
8.0.90.0070.00016.85
8.0.80.0080.01116.97
8.0.70.0060.00316.86
8.0.60.0000.00716.85
8.0.50.0050.00216.96
8.0.30.0110.01117.13
8.0.20.0060.01217.45
8.0.10.0000.00717.10
8.0.00.0100.00716.85
7.4.330.0000.00516.79
7.4.320.0000.00816.66
7.4.300.0030.00316.66
7.4.290.0030.00316.79
7.4.280.0060.00316.59
7.4.270.0050.00316.66
7.4.260.0030.00316.56
7.4.250.0000.00716.64
7.4.240.0040.00416.66
7.4.230.0040.00416.50
7.4.220.0000.00816.75
7.4.210.0090.00616.71
7.4.200.0030.00316.75
7.4.160.0080.00816.56
7.4.140.0140.00617.86
7.4.130.0170.00716.66
7.4.120.0000.01716.71
7.4.110.0160.00616.72
7.4.100.0060.01416.70
7.4.90.0070.01016.71
7.4.80.0180.00619.39
7.4.70.0090.00916.59
7.4.60.0080.00816.42
7.4.50.0070.01016.60
7.4.40.0120.00416.65
7.4.00.0060.00915.11
7.3.330.0020.00213.34
7.3.320.0030.00313.54
7.3.310.0000.00716.51
7.3.300.0000.00716.45
7.3.290.0030.00316.57
7.3.280.0120.00316.51
7.3.260.0100.00716.64
7.3.240.0080.01016.63
7.3.230.0060.01216.50
7.3.210.0070.01116.77
7.3.200.0090.00616.70
7.3.190.0160.00716.54
7.3.180.0140.00716.44
7.3.170.0110.01116.56
7.3.160.0130.00316.52
7.3.120.0090.00715.05
7.3.110.0080.00715.12
7.3.100.0060.00815.00
7.3.90.0060.01114.97
7.3.80.0110.00315.03
7.3.70.0070.00714.90
7.3.60.0050.00815.11
7.3.50.0060.00914.82
7.3.40.0050.01114.93
7.3.30.0100.00514.90
7.3.20.0080.00316.68
7.3.10.0040.00916.76
7.3.00.0120.00615.94
7.2.330.0060.01116.65
7.2.320.0030.01416.94
7.2.310.0100.01416.75
7.2.300.0070.01016.91
7.2.290.0120.01216.85
7.2.250.0100.00715.19
7.2.240.0080.01215.10
7.2.230.0040.01315.22
7.2.220.0020.01215.24
7.2.210.0090.00615.24
7.2.200.0030.01015.03
7.2.190.0070.00815.14
7.2.180.0060.00715.17
7.2.170.0030.01015.27
7.2.130.0320.00614.86
7.2.120.0440.01014.75
7.2.110.0380.00915.05
7.2.100.0260.00415.11
7.2.90.0170.01014.94
7.2.80.0180.00615.07
7.2.70.0230.00715.26
7.2.60.0520.00614.97
7.2.50.0350.01315.02
7.2.40.0300.01015.12
7.2.30.0480.00615.23
7.2.20.0340.01014.89
7.2.10.0220.00615.36
7.2.00.0420.00014.94
7.1.330.0000.01415.93
7.1.320.0070.00516.00
7.1.310.0050.00416.05
7.1.300.0050.00415.93
7.1.290.0060.00716.02
7.1.280.0090.00415.88
7.1.270.0000.01015.82
7.1.260.0090.00615.95
7.1.250.0270.00714.31
7.0.330.0420.00613.47
5.6.380.0100.00614.43

preferences:
65.64 ms | 400 KiB | 5 Q