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); $a = array($o1, $o2, $o3); foreach($a as $o){ sort($a->o->distance); } var_dump($a);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Attempt to modify property "o" on array in /in/4YN63:22 Stack trace: #0 {main} thrown in /in/4YN63 on line 22
Process exited with code 255.

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