|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-12-11 15:25 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2017-12-11 15:25 UTC] cmb@php.net
[2017-12-11 19:47 UTC] erik at evanv dot nl
[2017-12-11 22:25 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Description: ------------ Code speaks for itself. This can lead to data corruption. A decent solution would be to display unknown least significant digits as 0 just like %f. Alternative would be an ArithmeticError. Test script: --------------- php > $var = PHP_INT_MAX * 2; php > echo sprintf("%f", $var); 18446744073709551616.000000 php > echo sprintf("%u", $var); 0 Expected result: ---------------- 18446744073709551616 Actual result: -------------- 0