3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function experiment1($first, $two='') { echo $first . ' - ' . $two . "\n"; } function experiment2($first, $two='') { global $two; echo $first . ' - ' . $two . "\n"; } $two = 2; experiment1(1); experiment1(1, 3); experiment2(1); experiment2(1,3);
based on TRBM0
Output for 5.3.19 - 7.2.0
1 - 1 - 3 1 - 2 1 - 2