PHP 8.5.0 Alpha 4 available for testing

Voting

: min(one, two)?
(Example: nine)

The Note You're Voting On

stephen [ at ] brooksie-net [ dot ] co [ dot ] uk
12 years ago
ksort and krsort fail to undestand scientific notation, https://bugs.php.net/bug.php?id=43053, therefore when sorting numeric keys, if the key is of the form 0.00001 php will represent it as 1.0E-5.

These methods will assume this to be a string and therefore not organise your array as you may expect.

When using value of this form for array keys use sprintf('%f', 0.00001) to generate the key, for smaller values the precision needs to be included
e.g. sprintf('%0.10f', 0.00000001)

<< Back to user notes page

To Top