3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Point { public function __construct( private int $y, private int $x, private string $debug, ) {} } // Order is intended to be like ORDER BY x, y // Because the order properties are declared, it becomes ORDER BY y, x $data = [ new Point(3,1,'should be third'), new Point(1,1,'should be first'), new Point(1,2,'should be fourth'), new Point(2,1,'should be second'), ]; sort($data); print_r($data);

preferences:
33.65 ms | 405 KiB | 5 Q