Req #34116 [Asn->Csd]: support for variable length printf strings
| From: | nikic@php.net | Date: | Fri, 19 Jun 2020 10:23:49 +0000 |
| Subject: | Req #34116 [Asn->Csd]: support for variable length printf strings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227555@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=34116&edit=1
ID: 34116
Updated by: nikic@php.net
Reported by: ondrej at sury dot org
Summary: support for variable length printf strings
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: Strings related
PHP Version: 4CVS-2005-08-13 (stable)
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
This is supported as of PHP 8.
Previous Comments:
------------------------------------------------------------------------
[2005-08-13 11:35:51] ondrej at sury dot org
Description:
------------
PHP's printf does not support variable width/precision.
Compare that with "printf '%*s' 10 'foobar'" in a shell script.
Reproduce code:
---------------
<?php
$length = 10;
printf("%*s", $length, "foobar");
?>
Expected result:
----------------
foobar
Actual result:
--------------
s
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=34116&edit=1