|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2003-05-31 09:01 UTC] derick@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 23:00:01 2025 UTC | 
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