3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$var) { $var++; } function bar() // Note the missing & { $a = 5; return $a; } foo(bar()); // Produces fatal error since PHP 5.0.5 foo($a = 5); // Expression, not variable foo(5); // Produces fatal error ?>
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.40, 5.5.24, 5.6.8
Fatal error: Only variables can be passed by reference in /in/IjgS3 on line 14
Process exited with code 255.

preferences:
73.81 ms | 402 KiB | 77 Q