3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a{ public function b(){ echo 'toto'; } } $a = new a(); $method = 'b'; var_dump(is_callable(array($a,$method))); $a->$method(); function uc_words($str, $destSep='_', $srcSep='_') { return str_replace(' ', $destSep, ucwords(str_replace($srcSep, ' ', $str))); } $attr = 'mon_code_attribut'; echo uc_words($attr,'');
based on LPnYB
Output for 5.3.17 - 7.2.0
bool(true) totoMonCodeAttribut