kphp
kphp copied to clipboard
ksort work incorrectly with PHP 8 string to number comparison behavior
Example:
<?php
$array = [700 => 0, "600" => 1, "goo" => 2, "aaa" => 3];
ksort($array);
print_r($array);
If you run KPHP with PHP 8 behavior, the result is different from PHP 8.
See https://wiki.php.net/rfc/string_to_number_comparison See https://github.com/VKCOM/kphp/pull/298
This was a bug in PHP 8. Here is our pr in php-src