3v4l.org

run code in 300+ PHP versions simultaneously
<?php function toUpperCamelCase(string $text): string { $replacement = ""; $text = delete_all_between('(', ')', $text); $text = preg_replace("/(\b(de|du|la|le|et)\b)|(\b((l|d)[',’]))/i", ' ', $text); var_dump($text) // $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); // $text = ucwords($text); // $text = preg_replace('~[^\pL\d]+~u', $replacement, $text); // $text = trim($text, $replacement); // $text = preg_replace('~-+~', $replacement, $text); return $text; } function delete_all_between(string $beginning, string $end, string $string): string { $beginningPos = strpos($string, $beginning); $endPos = strpos($string, $end); if ($beginningPos === false || $endPos === false) { return $string; } $textToDelete = substr($string, $beginningPos, ($endPos + strlen($end)) - $beginningPos); return str_replace($textToDelete, '', $string); } echo toUpperCamelCase("Identifiant de l’organisme destinataire de la déclaration néant");

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)
7.1.70.0070.01017.04
7.1.60.0200.01035.09
7.1.50.0350.00934.72
7.1.40.0300.01634.19
7.1.30.0190.01834.27
7.1.20.0290.01734.35
7.1.10.0030.01716.40
7.1.00.0140.01116.33
7.0.200.0110.00416.48
7.0.190.0080.01116.34
7.0.180.0180.00516.15
7.0.170.0090.01515.96
7.0.160.0110.01116.11
7.0.150.0110.01016.13
7.0.140.0070.01016.11
7.0.130.0100.00916.23
7.0.120.0130.01616.32
7.0.110.0070.01616.05
7.0.100.0150.00716.01
7.0.90.0060.01516.15
7.0.80.0070.01215.93
7.0.70.0120.00616.02
7.0.60.0110.01015.73
7.0.50.0070.01316.10
7.0.40.0070.01116.27
7.0.30.0000.01416.09
7.0.20.0060.01116.16
7.0.10.0070.01316.14
7.0.00.0100.01016.24

preferences:
140.66 ms | 1394 KiB | 7 Q