php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7863 str_pad only taking 3 params, not 4
Submitted: 2000-11-17 06:44 UTC Modified: 2000-11-17 09:24 UTC
From: rickey at lefteris dot cix dot co dot uk Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.3pl1 OS: SunOS 5.6
Private report: No CVE-ID: None
 [2000-11-17 06:44 UTC] rickey at lefteris dot cix dot co dot uk
the str_pad function generates

"Warning: Wrong parameter count for str_pad() plus file and line number stuff."

from a line of code like 

str_pad( 12, 4, "0", STR_PAD_LEFT);

docs say str_pad should take 4 parameters, but only works with 3. Looks like you cant specify PAD_TYPE so function only does right padding.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-17 09:24 UTC] andrei@php.net
Please make sure you are using the correct version of PHP. In PHP 4.0.2 and later, str_pad() definitely allows 4 arguments.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC