3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = "foo"; var_dump($a[7] = ""); var_dump($a);
based on Yeigs
Output for 7.1.0
Warning: Cannot assign an empty string to a string offset in /in/AiKCT on line 3 NULL string(3) "foo"
Output for 5.2.6 - 5.2.9, 5.2.12 - 5.6.28, 7.0.0 - 7.0.14
string(1) "" string(8) "foo "
Output for 4.3.3 - 5.2.5, hhvm-3.10.0 - 3.12.0
string(0) "" string(8) "foo "
Output for 5.2.10 - 5.2.11
Notice: Uninitialized string offset: 7 in /in/AiKCT on line 3 string(1) "" string(8) "foo "
Output for 4.3.0 - 4.3.2
NULL string(8) "foo "