3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = function(){ echo $this->getX(); }; class Test { private $x; public function __construct($x) { $this->x = $x; } public function setX($x){ $this->x = $x; } public function getX(){ return $this->x; } } $t1 = new Test(100); $t2 = new Test(600); $f->call($t1); $closure = $f->bindTo($t2); $closure();
Output for git.master, git.master_jit, rfc.property-hooks
100600

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