3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id = 'hierarchical_select'; print preg_replace('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id);

preferences:
53.97 ms | 402 KiB | 5 Q