PHP 8.4.24 Released!

Voting

: five plus one?
(Example: nine)

The Note You're Voting On

stephenakins at gmail dot com
9 years ago
I have two servers; one running 5.6 and another that is running 7.  Using this function on the two servers gets me different results when all of the values are the same.  

<?php

$list = json_decode('{"706":2,"703":2,"702":2,"696":2,"658":2}', true);

print_r($list);

arsort($list);
echo "<br>";

print_r($list);

?>

PHP 5.6 results:
Array ( [706] => 2 [703] => 2 [702] => 2 [696] => 2 [658] => 2 ) 
Array ( [658] => 2 [696] => 2 [702] => 2 [703] => 2 [706] => 2 )

PHP 7 results:
Array ( [706] => 2 [703] => 2 [702] => 2 [696] => 2 [658] => 2 ) 
Array ( [706] => 2 [703] => 2 [702] => 2 [696] => 2 [658] => 2 )

<< Back to user notes page

To Top