3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php header('Content-Type: text/plain'); $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/8AT3d on line 10 Warning: Cannot assign an empty string to a string offset in /in/8AT3d on line 12 Warning: Cannot assign an empty string to a string offset in /in/8AT3d on line 12 abcdefghi
Output for 4.3.0 - 7.0.14
abcghi