3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['x' => 0.5, 'y' => 23], ['x' => 23, 'y' => 21.75], ['x' => 14.25, 'y' => 21.875], ['x' => 19.375, 'y' => 21.75], ['x' => 9.125, 'y' => 21.875], ['x' => 23, 'y' => 19.625], ['x' => 19.375, 'y' => 19.625], ]; foreach ($array as $row) { $result['#' . $row['y']] ??= $row; } var_export(array_values($result));

preferences:
98.22 ms | 405 KiB | 5 Q