ID: 23921 Updated by: [EMAIL PROTECTED] Reported By: abajolet at toiletoine dot net -Status: Open +Status: Closed Bug Type: Strings related Operating System: Linux Mandrake 8.1 PHP Version: 4.3.2 New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [2003-05-31 08:42:54] abajolet at toiletoine dot net Hello. I just discover strange behavior of printf/sprintf : This code : <?php printf('%01.2f',0.2); print '<br>'; $test = sprintf('%01.2f',0.2); print strlen($test).'<br>'; print ord(substr($test,-1)).'<br>'; printf('%01.2f',-0.2); print '<br>'; $test = sprintf('%01.2f',-0.2); print strlen($test).'<br>'; print ord(substr($test,-1)).'<br>'; ?> Give me : 0.20 4 48 -0.20<invisible character there -> mozilla displays a square> 6 0 It seems that the bug #6192 is back ! With php 4.3.0, this bug did not appear, with exactly the same config but php itself. Compile options, both 4.3.0 and 4.3.2 : ./configure --with-apxs2=/usr/local/apache2/bin/apxs \ --with-config-file-path=/etc \ --with-ming \ --with-ldap \ --with-mysql \ --with-pgsql \ --with-gd \ --with-jpeg-dir=../jpeg-6b \ --with-png-dir=../libpng-1.2.2 \ --with-freetype-dir=../freetype-2.1.0 \ --with-t1lib \ --enable-bcmath \ --enable-calendar \ --enable-trans-sid \ --with-mcrypt \ --with-mhash \ --with-regex=php \ --with-zlib \ --enable-ftp \ --with-openssl \ --with-snmp \ --enable-ucd-snmp-hack \ --enable-sockets \ --enable-track-vars \ --enable-magic-quotes \ --enable-xslt \ --with-xslt-sablot \ --with-iconv=/usr/local \ --enable-sigchild \ --enable-inline-optimization Best regards, Antoine Bajolet ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23921&edit=1
