3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function &counter() { static $c = 0; $c++; echo $c."\n"; return $c; } $cnt1 =& counter(); $cnt1++; // this does not influence counter $cnt2 =& counter(); $cnt2++; // this does influence counter counter();
based on QNXfq
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
1 3 5