public static function isVariableRef($string)
    {
        $firstBrace = substr($string, 0, 1);
        $secondBrace = substr($string, -1);

        if ($firstBrace == '{' && $secondBrace == '}') {
            return self::isIdentifier(substr($string, 1, -1));
        } else {
            return self::isIdentifier($string);
        }
    }
public static function isVariableRef($string)
    {
        $firstBrace = substr($string, 0, 1);
        $secondBrace = substr($string, -1);

        if ($firstBrace == '{' && $secondBrace == '}') {
            return self::isIdentifier(substr($string, 1, -1));
        } else {
            return self::isIdentifier($string);
        }
    }
public static function isVariableRef ( $ string ) { $ firstBrace = substr ( $ string , 0 , 1 ) ; $ secondBrace = substr ( $ string , - 1 ) ; if ( $ firstBrace == '{' && $ secondBrace == '}' ) { return self :: isIdentifier ( substr ( $ string , 1 , - 1 ) ) ; } else { return self :: isIdentifier ( $ string ) ; } }
Whether or not a given string is a variable ref.

@param string $string A given string.
@return boolean Wheter $string is a valid variable ref.
@example '{myIdentifier1}' is a valid variable ref but 'myIdentifier1' is not.
Whether or not a given string is a variable ref .