Text.php
public static function camelCase($word, bool $ucFirstWord = true): string
    {
        static $words = [];
        
        if (!isset($words[$word])) {
            $words[$word] = str_replace(' ', '', ucwords(strtr($word, '_', ' ')));
            if (!$ucFirstWord) {
                substr_replace($words[$word], $word{0}, 0, 1);
            }
        }
        return $words[$word];
    }
public static function camelCase($word, bool $ucFirstWord = true): string
    {
        static $words = [];
        
        if (!isset($words[$word])) {
            $words[$word] = str_replace(' ', '', ucwords(strtr($word, '_', ' ')));
            if (!$ucFirstWord) {
                substr_replace($words[$word], $word{0}, 0, 1);
            }
        }
        return $words[$word];
    }
public static function camelCase ( $ word , bool $ ucFirstWord = true ) : string { static $ words = [ ] ; if ( ! isset ( $ words [ $ word ] ) ) { $ words [ $ word ] = str_replace ( ' ' , '' , ucwords ( strtr ( $ word , '_' , ' ' ) ) ) ; if ( ! $ ucFirstWord ) { substr_replace ( $ words [ $ word ] , $ word { 0 } , 0 , 1 ) ; } } return $ words [ $ word ] ; }
some_phrase => SomePhrase
@param mixed $word
@param bool $ucFirstWord
@return string
some_phrase = > SomePhrase