3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Customer { public $score; public function __construct($score) { $this->score = $score; } } $customers = []; $customers[] = new Customer(13); $customers[] = new Customer(11); $customers[] = new Customer(14); $customers[] = new Customer(10); $customers[] = new Customer(12.5); usort($customers, function($a, $b) { var_dump($b->score, $a->score, $b->score - $a->score); return $b->score - $a->score; }); var_dump($customers);
Output for git.master, git.master_jit, rfc.property-hooks
int(11) int(13) int(-2) int(14) int(11) int(3) int(14) int(13) int(1) int(10) int(11) int(-1) float(12.5) int(10) float(2.5) float(12.5) int(11) float(1.5) float(12.5) int(13) float(-0.5) array(5) { [0]=> object(Customer)#3 (1) { ["score"]=> int(14) } [1]=> object(Customer)#1 (1) { ["score"]=> int(13) } [2]=> object(Customer)#5 (1) { ["score"]=> float(12.5) } [3]=> object(Customer)#2 (1) { ["score"]=> int(11) } [4]=> object(Customer)#4 (1) { ["score"]=> int(10) } }

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:
70.38 ms | 402 KiB | 8 Q