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);
Output for git.master_jit, git.master
Array ( [0] => Point Object ( [y:Point:private] => 1 [x:Point:private] => 1 [debug:Point:private] => should be first ) [1] => Point Object ( [y:Point:private] => 1 [x:Point:private] => 2 [debug:Point:private] => should be fourth ) [2] => Point Object ( [y:Point:private] => 2 [x:Point:private] => 1 [debug:Point:private] => should be second ) [3] => Point Object ( [y:Point:private] => 3 [x:Point:private] => 1 [debug:Point:private] => should be third ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
24.37 ms | 407 KiB | 5 Q