3v4l.org

run code in 300+ PHP versions simultaneously
<?php function camelCase($str) { $i = array("-","_"); $str = preg_replace('/([a-z])([A-Z])/', "\\1 \\2", $str); $str = preg_replace('@[^a-zA-Z0-9\-_ ]+@', '', $str); $str = str_replace($i, ' ', $str); $str = str_replace(' ', '', ucwords(strtolower($str))); $str = strtolower(substr($str,0,1)).substr($str,1); return $str; } function uncamelCase($str) { $str = preg_replace('/([a-z])([A-Z])/', "\\1_\\2", $str); $str = strtolower($str); return $str; } $camel = camelCase("James_LIKES-camelCase"); $uncamel = uncamelCase($camel); echo $camel." ".$uncamel;
Output for git.master, git.master_jit, rfc.property-hooks
jamesLikesCamelCase james_likes_camel_case

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:
151.53 ms | 405 KiB | 5 Q