Re: PHP 4.0 Bug #8803 Updated: crazy implementation of printf/sprintf
| From: | Mike Banahan | Date: | Fri, 19 Jan 2001 15:31:44 +0000 |
| Subject: | Re: PHP 4.0 Bug #8803 Updated: crazy implementation of printf/sprintf | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-44567@lists.php.net to get a copy of this message | ||
On Fri, Jan 19, 2001 at 03:10:38PM -0000, Bug Database wrote:
> ID: 8803
> Updated by: derick
> Reported By: mikeb@gbdirect.co.uk
> Old-Status: Open
> Status: Closed
> Bug Type: Unknown/Other Function
> Assigned To:
> Comments:
>
> This works fine:
>
> echo sprintf ("%2x", 29);
>
> output:
> 1d
>
> This is not a bug.
Forgive me, but I disagree. Using "%2x" is not the same since it omits the leading
zero that "%.2x" gives in C/C++. Using the existing sprintf to build HTML colour strings
like "#0C0E2D" from a red/green/blue triple is made much harder unless there is a
workaround.
You can consider not supporting a standard like ANSI/ISO to not be a bug, but you will
likely be in a minority there.
Sorry, I don't want to carp - but it IS a problem for me.
All the best,
Mike
--
Mike Banahan - GBdirect 27 Park Drive Bradford England BD9 4DS
Tel 01274 772277 Fax 01274 772281
Put reality back into cyberspace: http://somewherenear.com