Re: str_pad() proposed changes
| From: | Andrei Zmievski | Date: | Fri, 07 Jul 2000 20:44:38 +0000 |
| Subject: | Re: str_pad() proposed changes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5451@lists.php.net to get a copy of this message | ||
On Fri, 07 Jul 2000, Matthew Leverton wrote:
> I never use the padding, although I use the trimming.
>
> Couldn't you actually still add backwards compatibility (if necessary)
> by adding a default case for the type if it is left blank?
> It'd probably be sloppy, but something like:
>
> string str_pad(string $str, int $x, int $type = NONE)
> {
> if ($type == NONE) {
> // current string pad goes here
> }
> else {
> // new string pad goes here
> }
> }
It's possible, but I'd rather make a clean break. If I don't get any
strenuous objections, I'll go ahead and modify it tomorrow.
> Or there could always be a new name for the function, like
> string_pad().
We'd like to be consistent and use str_ prefix.
-Andrei
* Use the source, Luke. *