3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [['price' => 3800, 'id' => 400015], ['price' => 3700, 'id' => 400015], ['price' => 3300, 'id' => 400018], ['price' => 3000, 'id' => 400018], ['price' => 3100, 'id' => 400020], ['price' => 3400, 'id' => 400020], ]; usort($data, function($a, $b) { return $a['price'] <=> $b['price']; }); $maxPrices = array_column($data, 'price', 'id'); usort($data, function($a, $b) { return $b['price'] <=> $a['price']; }); $minPrices = array_column($data, 'price', 'id'); foreach($minPrices as $id => $minPrice) { echo 'id:', $id, ', Price=', $minPrice, '-', $maxPrices[$id], PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
id:400015, Price=3700-3800 id:400020, Price=3100-3400 id:400018, Price=3000-3300

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:
125.74 ms | 405 KiB | 5 Q