3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = "1234567890"; var_dump($a[010], isset($a[010])); // true var_dump($a["010"], isset($a["010"])); // false; 10進数の10として認識されている $a .= "a"; var_dump($a["010"], isset($a["010"])); // true
Output for 5.2.10 - 7.1.0
string(1) "9" bool(true) Notice: Uninitialized string offset: 10 in /in/idqXt on line 5 string(0) "" bool(false) string(1) "a" bool(true)
Output for 4.3.3 - 4.4.9, 5.0.3 - 5.0.5, 5.1.1 - 5.2.9
string(1) "9" bool(true) Notice: Uninitialized string offset: 10 in /in/idqXt on line 5 string(0) "" bool(false) string(1) "a" bool(true)
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/idqXt on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.2
string(1) "9" bool(true) Notice: Uninitialized string offset: 10 in /in/idqXt on line 5 string(0) "" bool(false) string(1) "a" bool(false)
Output for 4.3.0 - 4.3.2
string(1) "9" bool(true) Notice: Uninitialized string offset: 10 in /in/idqXt on line 5 Notice: Uninitialized string offset: 10 in /in/idqXt on line 5 string(0) "" bool(false) string(1) "a" bool(true)