3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function increment(&$v) { $v++; } $v = 1; $func = 'increment'; // Generates warning. call_user_func('increment', $v); var_dump($v); // Increments! $func($v); var_dump($v);
Output for 5.3.0 - 5.6.25, 7.0.0 - 7.1.0
Warning: Parameter 1 to increment() expected to be a reference, value given in /in/1rr9P on line 11 int(1) int(2)
Output for 4.3.0 - 5.2.17, hhvm-3.10.0 - 3.12.0
int(1) int(2)