3v4l.org

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