3v4l.org

run code in 500+ PHP versions simultaneously
<?php function hook( &$x, &$y, $w, $z ) { $x++; $y++; $w++; $z++; } class Hooks { public static function run( $name, $args ) { call_user_func_array( $name, $args ); } public static function run2( $name, $args ) { $args2 = []; foreach ( $args as &$arg ) { $args2[] = &$arg; } call_user_func_array( $name, $args2 ); } } $x = $y = $w = $z = 0; echo "start: $x:$y:$w:$z\n\n"; Hooks::run( 'hook', [ $x, &$y, $w, &$z ] ); echo "run: $x:$y:$w:$z\n\n"; Hooks::run2( 'hook', [ $x, &$y, $w, &$z ] ); echo "run2: $x:$y:$w:$z\n\n";
Output for rfc.property-hooks, git.master, git.master_jit
start: 0:0:0:0 Warning: hook(): Argument #1 ($x) must be passed by reference, value given in /in/nlVpT on line 9 run: 0:1:0:0 run2: 0:2:0:0

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:
126.16 ms | 2683 KiB | 4 Q