3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function takeMyReferencePlease(& $myReference) { var_dump($myReference); } $a = 'foo'; takeMyReferencePlease($a); takeMyReferencePlease($b = 'bar');
based on UgHJq
Output for 7.0.0 - 7.1.0
string(3) "foo" Notice: Only variables should be passed by reference in /in/ii2iK on line 10 string(3) "bar"
Output for hhvm-3.10.0 - 3.12.0
string(3) "foo" Strict Warning: Only variables should be passed by reference in /in/ii2iK on line 10 string(3) "bar"
Output for 5.1.2 - 5.6.28
string(3) "foo" Strict Standards: Only variables should be passed by reference in /in/ii2iK on line 10 string(3) "bar"
Output for 4.3.0 - 5.1.1
string(3) "foo" string(3) "bar"