3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function camelCase($string) { preg_replace_callback('/(?:^|_)(.?)/',"strtoupper('$1')",$string); return $string; } echo camelCase('common/home'); echo camelCase('common_home');
based on gn8X2
Output for 5.2.0 - 7.2.0
Warning: preg_replace_callback(): Requires argument 2, 'strtoupper('$1')', to be a valid callback in /in/icYNO on line 4 common/home Warning: preg_replace_callback(): Requires argument 2, 'strtoupper('$1')', to be a valid callback in /in/icYNO on line 4 common_home
Output for 5.0.0 - 5.1.6
Warning: preg_replace_callback(): requires argument 2, 'strtoupper('$1')', to be a valid callback in /in/icYNO on line 4 common/home Warning: preg_replace_callback(): requires argument 2, 'strtoupper('$1')', to be a valid callback in /in/icYNO on line 4 common_home
Output for 4.3.0 - 4.4.9
Warning: preg_replace_callback() requires argument 2, 'strtoupper('$1')', to be a valid callback in /in/icYNO on line 4 common/home Warning: preg_replace_callback() requires argument 2, 'strtoupper('$1')', to be a valid callback in /in/icYNO on line 4 common_home