|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-09 18:56 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Description: ------------ str_pad returns the exact same string that was entered as the string input. str_repeat returns 0 length string. './configure' '--localstatedir=/var/hsphere/php' '--with-apxs=/hsphere/shared/apache/bin/apxs' '--with-openssl=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-bz2=/usr' '--enable-calendar' '--with-jpeg-dir=/usr' '--enable-ftp' '--with-gd' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-png-dir=/usr' '--with-gettext=/usr' '--with-imap=/hsphere/shared' '--with-mysql=/usr' '--with-pgsql=/usr' '--with-curl=/hsphere/shared' '--with-curlwrappers' '--with-mhash=/usr' '--with-iconv=/hsphere/shared' '--enable-sockets' '--with-zip=/usr' '--enable-versioning' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--enable-mbstring' '--disable-debug' Reproduce code: --------------- <?php echo "<br>Start Test!<br>"; echo "<pre>"; var_dump( str_repeat(4, "../") ); echo "\r\n"; var_dump( str_pad("TESTING", 6, "../", STR_PAD_LEFT) ); echo "\r\n"; var_dump( str_pad("TESTING", 6, "-==") ); echo "\r\n"; var_dump( str_pad("TEST", 4) ); echo "</pre>"; echo "<br>End Test!<br>"; exit(0); ?> Expected result: ---------------- Start Test! string(0) "../../../../" string(7) "../../../../../TESTING" string(7) "TESTING-==-==-==-==-==-==" string(4) "TEST " End Test! Actual result: -------------- Start Test! string(0) "" string(7) "TESTING" string(7) "TESTING" string(4) "TEST" End Test!