Re: PHP 4.0 Bug #6131: str_pad does not accept optional fourth parameter

From: Date: Sun, 20 Aug 2000 23:05:25 +0000
Subject: Re: PHP 4.0 Bug #6131: str_pad does not accept optional fourth parameter
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-29971@lists.php.net to get a copy of this message
billn@gct-us.com wrote: > > str_pad does not accept optional fourth parameter. Adding STR_PAD_LEFT > or any fourth parameter causes Warning: Wrong parameter count for str_pad() error > > Example script: > $emailpass=str_pad($emailpass, 12, " ", STR_PAD_LEFT); After looking at the sources, it's obvious that the implementation of the optional fourth argument does not exist :) For now, you can do it this way : $emailpass=str_pad($emailpass, -12, " "); It works. I think I'll implement it soon though, because it's more readable this way. Flavien.

« previous php.dev (#29971) next »