3v4l.org

run code in 300+ PHP versions simultaneously
<?php function snakeToCamel($string) { $words = explode('_', $string); $camel = ''; foreach ($words as $word) { $camel .= ucfirst($word); } return $camel; } /** * underdash_separated -> camelCase. * @param string * @return string */ function underdashToCamel($s) { $s = strtolower($s); $s = preg_replace('#_(?=[a-z])#', ' ', $s); $s = substr(ucwords('x' . $s), 1); $s = str_replace(' ', '', $s); return $s; } echo snakeToCamel("ahoj_vole_todle_1_je_PECKE__") . "\n"; echo underdashToCamel("ahoj_vole_todle_1_je_PECKE__") . "\n";
Output for git.master, git.master_jit, rfc.property-hooks
AhojVoleTodle1JePECKE ahojVoleTodle_1JePecke__

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
52.79 ms | 401 KiB | 8 Q