3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function snakeToCamel($text, $firstUpper = true) { $regex = '/('; if ($firstUpper) { $regex .= '^|'; } $regex .= '_)([a-z])/'; return preg_replace_callback($regex, function($match) {return strtoupper($match[2]), $text); } echo snakeToCamel('testFooBar');
based on PTIlG
Output for 7.0.0
Parse error: syntax error, unexpected ',', expecting ';' in /in/SqSTM on line 11
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected ',' in /in/SqSTM on line 11
Process exited with code 255.