#21318 [Opn->Csd]: str_pad will pad even if input_len + pad_str_len > pad_length

From: Date: Sat, 05 Jul 2003 06:43:44 +0000
Subject: #21318 [Opn->Csd]: str_pad will pad even if input_len + pad_str_len > pad_length
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969355048@lists.php.net to get a copy of this message
ID: 21318 Updated by: derick@php.net Reported By: jc at mega-bucks dot co dot jp -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Linux PHP Version: 4.3.0 Assigned To: hholzgra New Comment: It was closed as a "documentation problem", so it was fixed in the docs. Previous Comments: ------------------------------------------------------------------------ [2003-07-04 21:33:27] jc at mega-bucks dot co dot jp Could you state *how* the bug was fixed? i.e. was the behaviour of the function changed or was the documentation changed to explain the current behaviour? Thanks! ------------------------------------------------------------------------ [2003-07-04 17:08:15] hholzgra@php.net This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2003-01-01 05:35:33] jc at mega-bucks dot co dot jp str_pad pad the input string even when the length of the pad string cannot be evenly dived into the length of the input stirng + pad_length. This is not necessarily a bug but the behaviour should be documented. I.e. in some cases the user might want the string be padded only with *full-length* pad strings, and not truncated pad strings. The following code illustrates: echo str_pad("1", 2, "AB"); OUPUT: 1A The output could be viewed as "incorrect" since pad_str was aksed to pad with "AB", not to pad with "A". Thanks! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21318&edit=1

« previous php.doc (#969355048) next »