3v4l.org

run code in 300+ PHP versions simultaneously
<?php $params = [1,2,3]; function transform(array &$params) { $references = []; foreach ($params as &$value) { $references[] = &$value; } $value = "foo"; return $references; } var_dump($params); $p = transform($params); var_dump($p); debug_zval_dump($p, $params);
Output for git.master, rfc.property-hooks
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) { [0]=> &int(1) [1]=> &int(2) [2]=> &string(3) "foo" } array(3) refcount(2){ [0]=> reference refcount(2) { int(1) } [1]=> reference refcount(2) { int(2) } [2]=> reference refcount(2) { string(3) "foo" interned } } array(3) refcount(2){ [0]=> reference refcount(2) { int(1) } [1]=> reference refcount(2) { int(2) } [2]=> reference refcount(2) { string(3) "foo" interned } }
Output for git.master_jit
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) { [0]=> &int(1) [1]=> &int(2) [2]=> &string(3) "foo" } array(3) refcount(2){ [0]=> reference refcount(2) { int(1) } [1]=> reference refcount(2) { int(2) } [2]=> reference refcount(2) { string(3) "foo" refcount(2) } } array(3) refcount(2){ [0]=> reference refcount(2) { int(1) } [1]=> reference refcount(2) { int(2) } [2]=> reference refcount(2) { string(3) "foo" refcount(2) } }

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:
103.67 ms | 402 KiB | 8 Q