|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-08 12:23 UTC] tony2001@php.net
[2004-12-08 12:32 UTC] mgf@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 15:00:01 2025 UTC |
Description: ------------ not 1!But it's must = 1 Reproduce code: --------------- $a=split(';' , $Ver); rsort($a); print_r($a); $S = array_sum($a); $f=floatval($S); if ($f == 1) { echo "Yes, it's 1"; } else { echo "<br>Not, it's not 1";} ?> Expected result: ---------------- Array ( [0] => 0.5 [1] => 0.2 [2] => 0.1 [3] => 0.1 [4] => 0.1 ) Yes, it's 1 Actual result: -------------- Array ( [0] => 0.5 [1] => 0.2 [2] => 0.1 [3] => 0.1 [4] => 0.1 ) Not, it's not 1