3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = "abcdefghi"; $p = 4; $n = 3; $p1 = $p-1; $s[$p1] = ''; while(--$n) { $s[++$p1] = ''; } echo $s;
Output for 7.1.0
Warning: Cannot assign an empty string to a string offset in /in/lTUHj on line 7 Warning: Cannot assign an empty string to a string offset in /in/lTUHj on line 9 Warning: Cannot assign an empty string to a string offset in /in/lTUHj on line 9 abcdefghi
Output for 5.2.15 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
abcghi