3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeClass { public function getValues($tool, $built, $par) { // lets mock some data $mocks = array( array(0, 1, 2, 17), array(1, 2, 42, 96), array(4, 5, 6, 7), array(10, 13, 8, 15)); var_dump($par); foreach ($mocks as &$mock) { $mock = array_map(function ($m) use ($par) {return $m * $par[1];}, $mock); } return $mocks; } } $a = array('php', 'ver 5.6', 3, 2); $instance = new SomeClass; $val = $instance->getValues($a[0], $a[1], array($a[2], $a[3])); $val[2][3]; echo $val;
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> int(3) [1]=> int(2) } Warning: Array to string conversion in /in/BNr40 on line 26 Array

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