3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Wrapper { public $values = [1,2]; public function foo (...$args) { return $this->dostuff(...$args); } public function dostuff($param1, $param2) { $this->values[] = $param1; $this->values[] = $param2; return count($this->values); } public function returnArray() { return $this->values; } } $values = [1,2]; $obj = new Wrapper(); $count = $obj->foo(3,4); echo "Elements count: $count\r\n"; print_r($obj->returnArray()); //Expected [1,2,3,4]
Output for git.master, git.master_jit, rfc.property-hooks
Elements count: 4 Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 )

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