#45117 [Com]: strval gives :.0E-7 for 1e-6
ID: 45117 Comment by: lmalgras at tennaxia dot com Reported By: rudolphi at chemie dot uni-kl dot de Status: Feedback Bug Type: Scripting Engine problem Operating System: Ubuntu 8.04 (32bit) PHP Version: 5.2.6 Assigned To: fb-req-jani New Comment: It seems to be the same issue as reported on #43487 Previous Comments: [2008-07-20 11:16:19] [EMAIL PROTECTED] What gcc version that openSuSE has? Try this on the ubuntus: Using fresh, just untarred/gunzipped php sources: # ./configure --disable-all --disable-cgi --enable-debug # make # php -n -r '$float=1e-6; var_dump($float, strval($float));' [2008-07-17 16:02:15] rudolphi at chemie dot uni-kl dot de On openSUSE 11, the problem cannot be reproduced either. Though, changing everything to openSUSE is not an option for me, sorry (usability is a nightmare). Isn't there any Ubuntu user out there who can reproduce this? [2008-07-17 15:02:31] rudolphi at chemie dot uni-kl dot de The error can be reproduced on two different machines: - my development machine (Core Duo 2300, 1GB) and - the production machine (Core 2 Quad 9450, 2GB), both running the 32bit version of Ubuntu 8.04 (including all updates, but no "proposed","backports" stuff) I cannot reproduce the error on - another testing machine (Core 2 Duo 6550, 2GB) running Ubuntu 7.10 64bit - a Windows 2003 Server - a Win XP Professional running Xampp I will try with some *nix-live cds and post the results very soon. [2008-07-16 19:18:24] [EMAIL PROTECTED] Are you able to reproduce this on some other machine? Or some other *nix / linux distro? Or does it only happen with on one single machine and OS? [2008-07-16 13:23:32] rudolphi at chemie dot uni-kl dot de My GCC-Version is 4.2.3-1ubuntu6, libgcc1 is 4.2.3-2ubuntu7 and my libc6 is 2.7-10ubuntu3 (the up-to-date-versions of Hardy Heron). Thanks a lot for your efforts in this topic. I have just recompiled PHP 5.2.6 (and restarted apache) to reproduce the error with the very versions mentioned above. The error is still there. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/45117 -- Edit this bug report at http://bugs.php.net/?id=45117&edit=1
#43487 [Com]: Wrong conversion of float to string
ID: 43487 Comment by: lmalgras at tennaxia dot com Reported By: jm at wo dot cz Status: Open Bug Type: Strings related Operating System: Linux PHP Version: 5.2.5 New Comment: I have the same problem with PHP 5.2.4 on Linux Reproduce code: --- php -n -r '$f=array(1E-4, 1E-5, 1E-6, 1E-7, 1E-8); foreach($f as $fval) echo $fval, "\n";' Expected result: 0.0001 1.0E-5 1.0E-6 1.0E-7 1.0E-8 Actual result: -- 0.0001 1.0E-5 :.0E-7 :.0E-8 1.0E-8 I have test this code on several configurations with the following results : PHP 5.2.0 (Linux) : Actual result PHP 5.2.2 (Linux) : Actual result PHP 5.2.3 (Windows): Actual result Previous Comments: [2007-12-06 23:59:16] jm at wo dot cz Obviously, I meant to say, the problem is with TWO numbers only: 1E-6 and 1E-7. J. [2007-12-06 23:55:54] jm at wo dot cz I got the same problem on another machine too, again PHP 5.2.5 with pretty much the same configuration. In fact, the problem exhibits also for version 5.2.4 on my machines. About the unknown configuration options: Thanks, I had seen the warning but did not have the time to edit my scripts and based on the message it seemed harmless to leave the options be for now. I am thinking that the problem and your inability to reproduce it could be due to some libraries that PHP uses that may be buggy in the versions on my systems. Can you please tell me what libraries, if any, to look for? Although the installed version of software are generally the latest stable releases, it is possible that a patch or a downgrade may be in order on some library/tool. Finally, the problem has so far appeared for 3 numbers only: $ php -n -r '$f=array(1E-4, 1E-5, 1E-6, 1E-7, 1E-8); foreach ($f as $fval) echo $fval, "\n";' 0.0001 1.0E-5 :.0E-7 :.0E-8 1.0E-8 Jan [2007-12-04 12:33:38] [EMAIL PROTECTED] I can't reproduce either: ]# php -r '$f=1E-6; echo $f, "\n";' 1.0E-6 And pretty much the same configure options. btw. Many of the options you used don't even exist, did you pay attention to the last lines of the output after running configure? (it warns you about unknown options) Try this yourself: # php -n -r '$f=1E-6; echo $f, "\n";' (-n makes sure you don't use any php.ini which might have different precision set) [2007-12-03 19:17:07] jm at wo dot cz Interesting that you can't reproduce it, I did not expect that, otherwise I would have provided the build info. Nevertheless, I have just recompiled php and the bug is still there. The glibc is 2.3.6 and gcc is 4.2.1. Here is the build set up: PHP_CONFIGURE="\ --prefix=/usr \ --sysconfdir=/etc \ --with-config-file-path=/etc \ --disable-static \ --disable-debug \ --disable-rpath \ --enable-inline-optimization \ --enable-pic \ --enable-bcmath \ --enable-calendar \ --enable-magic-quotes \ --enable-track-vars \ --enable-safe-mode\ --enable-sysvsem \ --enable-sysvshm \ --enable-force-cgi-redirect \ --enable-trans-sid\ --enable-yp \ --enable-ftp \ --enable-wddx \ --enable-filepro \ --enable-dbase\ --with-versioning \ --with-gettext\ --with-mod_charset\ --with-layout=GNU \ --with-zlib \ --with-bz2\ --enable-exif \ --with-regex=system \ --enable-mbstring=all \ --enable-mbregex \ --with-pspell \ --with-mhash \ --with-mcrypt \ --with-curl \ --with-gmp \ --with-openssl \ --with-pgsql=/usr \ --with-gdbm \ --with-xml --with-expat-dir=/usr \ --with-xsl\ --with-apxs2 \ --with-t1lib=/usr/share/t1lib \ --with-freetype-dir=/usr/lib\ --with-gd " ./configure $PHP_CONFIGURE [2007-12-03 18:41:25] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". T
#13936 [Com]: Magical Constant __FILE__ contains wrong information on included files
ID: 13936 Comment by: lmalgras at tennaxia dot com Reported By: jpm at phpbrasil dot com Status: Closed Bug Type: Scripting Engine problem Operating System: Solaris PHP Version: 4.3.0-dev New Comment: We have the same problem with PHP 4.3.3 on Windows 2000 SP1. Previous Comments: [2004-04-01 03:54:36] roy at pine dot nl We are running Solaris 7 with PHP 4.3.5 and the problem still exists. I have tested the same setup on a FreeBSD machine with PHP 4.3.4 where it works like intended. [2002-09-28 15:19:46] [EMAIL PROTECTED] 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. [2002-05-12 14:19:16] kumar at chicagomodular dot com this bug is also happening with OS: Open BSD 3.0, PHP 4.2.0 the following was generated on maintenenance-priority.php (the other __FILE__ prints were generated from the included files): __FILE__: /home2/kumar/www/chicagomodular.com/phpAdsNew/ admin/maintenance-priority.php __FILE__: /config.php __FILE__: /lib-maintenance.inc.php for the phpAdsNew application this is a serious bug since __FILE__ is used to define an include-path constant [2002-02-27 13:42:37] jpm at phpbrasil dot com Re-opening since this bug appear to be still going on. I didn't really test the fixes on 4.1.1 since I'm using a similar routine to report errors, but it would be nice to catch some attention. --Joao [2002-02-27 12:40:44] jas at cs dot yorku dot ca I was having problems with this same thing on Solaris under PHP 4.1.1, so I tried the 4.2 version, and it seems to me that the problem is still there. I create a file called "test.php" containing: When I: php test.php I get: file test.php I expect to get: file /cs/home/jas/test.php Shouldn't __FILE__ always return a full path to a file? Jason. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/13936 -- Edit this bug report at http://bugs.php.net/?id=13936&edit=1