Bug #9297 Updated: sprintf ("%f", $foo) crashes with very large $foo.

From: Date: Mon, 21 May 2001 23:04:21 +0000
Subject: Bug #9297 Updated: sprintf ("%f", $foo) crashes with very large $foo.
Groups: php.dev 
Request: Send a blank email to php-dev+get-56152@lists.php.net to get a copy of this message
ID: 9297 Updated by: derick Reported By: ben@bpeter.org Status: Feedback Bug Type: Strings related Operating system: PHP Version: 4.0.4pl1 Assigned To: Comments: It does something strange for me: [root@mars lib]# /usr/local/bin/php -q <? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%f\nn", $foo) ?> 2286484951194899000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022864849511948990000000000000000000000000000000000000000000000000000000000000000. This is with 4.0.6-dev (latest CVS (22/05/2001)). Derick Previous Comments: --------------------------------------------------------------------------- [2001-04-30 09:52:57] cmv@php.net Works fine for me (RH7 and latest CVS): [cmv@sunniva cmv]$ echo '<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%fn", $foo) ?>' | php X-Powered-By: PHP/4.0.6-dev Content-type: text/html 2286484951194899000000000000000000000000000000000000000000000000000000000000000n[cmv@sunniva cmv] --------------------------------------------------------------------------- [2001-04-30 09:17:45] andi@php.net Can you please try the latest CVS or a snapshot from snaps.php.net and let us know if this still happens. I can't reproduce it on redhat 6.2. Thanks. --------------------------------------------------------------------------- [2001-02-16 10:34:20] ben@bpeter.org [ben@home ben]$ echo '<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%fn", $foo) ?>' | php X-Powered-By: PHP/4.0.4pl1 Content-type: text/html 2286484951194899000000000000000000000000000000000000000000000000000000000000000 Segmentation fault (core dumped) --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9297&edit=2

« previous php.dev (#56152) next »