3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function f(&$ref1, &$ref2) { $ref1 = 'foo'; $ref2 = 'bar'; } } class b { public function __call($methodName, $arguments) { $a = new a(); call_user_func_array(array( $a, $methodName //->$methodName( $arguments[0][0], $arguments[0][1]); ), $arguments); } } $ref1 = 'X'; $ref2 = 'Y'; $b = new b(); $b->f( $ref1, $ref2); var_dump($ref1, $ref2);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: a::f(): Argument #1 ($ref1) must be passed by reference, value given in /in/M3au0 on line 18 Warning: a::f(): Argument #2 ($ref2) must be passed by reference, value given in /in/M3au0 on line 18 string(1) "X" string(1) "Y"

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