php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34116 support for variable length printf strings
Submitted: 2005-08-13 11:35 UTC Modified: 2016-12-30 22:59 UTC
Votes:4
Avg. Score:3.8 ± 1.3
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ondrej at sury dot org Assigned:
Status: Open Package: Strings related
PHP Version: 4CVS-2005-08-13 (stable) OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-08-13 11:35 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 22:59 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Strings related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 16:01:24 2019 UTC