3v4l.org

run code in 300+ PHP versions simultaneously
<?php class GeoCoder { protected $latitude; protected $longitude; public $distance; public function __construct($lat,$long,$dist) { $this->latitude = $lat; $this->longitude = $long; $this->distance = $dist; } } $o1 = new GeoCoder(-22.43,-46.81,1500.00); $o2 = new GeoCoder(-22.42,-46.82,1740.00); $o3 = new GeoCoder(-21.43,-46.80,152.00); $nu = null; if ($o1->distance > $o2->distance) { $nu[0] = $o2; $nu[1] = $o1; } else if ($o1->distance > $o3->distance) { $nu[0] = $o3->distance; $nu[2] = $o1->distance; } else { $nu[0] = $o1; $nu[2] = $o3; } var_dump($nu);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> float(152) [2]=> float(1500) }

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:
45.54 ms | 401 KiB | 8 Q