3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Obj { private $_name; public function getName() { if ($this->_name === null) { // Heavy DB query $this->_name = 'Foo'; } return $this->_name; } } $objects = array(new Obj(), new Obj()); usort($objects, function($a, $b) { if ($a->getName() < $b->getName()) { return 1; } else if ($a->getName() > $b->getName()) { return -1; } return 0; }); var_dump($objects);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> object(Obj)#1 (1) { ["_name":"Obj":private]=> string(3) "Foo" } [1]=> object(Obj)#2 (1) { ["_name":"Obj":private]=> string(3) "Foo" } }

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