3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = ''; // empty string $a[10] = 'a'; echo $a; // "Array" $b = ' '; // non empty string $b[10] = 'b'; echo $b; // " b"
Output for 7.1.0
a b
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
Notice: Array to string conversion in /in/AHWVK on line 5 Array b
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.2.9, 5.2.12 - 5.3.29
Array b
Output for 5.2.10 - 5.2.11
Array Notice: Uninitialized string offset: 10 in /in/AHWVK on line 8 b
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/AHWVK on line 9
Process exited with code 255.