3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function passByReference(&$test) { $test = "Changed!"; } function passByValue($test) { $test = "a change here will not affect the original variable"; } $test = 'Unchanged'; echo $test . PHP_EOL; passByValue($test); echo $test . PHP_EOL; passByReference($test); echo $test . PHP_EOL;
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.2.17, 5.4.39 - 7.3.0beta1
Unchanged Unchanged Changed!
Output for 5.3.0 - 5.4.38
Unchanged Unchanged Changed! PHP Deprecated: Comments starting with '#' are deprecated in /etc/php.ini on line 7 in Unknown on line 0
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/XRFZh on line 12 UnchangedPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/XRFZh on line 15 UnchangedPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/XRFZh on line 18 Changed!PHP_EOL