3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'abc'; var_dump($str['1']); var_dump(isset($str['1'])); var_dump($str['1.0']); var_dump(isset($str['1.0'])); var_dump($str['x']); var_dump(isset($str['x'])); var_dump($str['1x']); var_dump(isset($str['1x']));
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
string(1) "b" bool(true) Warning: Illegal string offset '1.0' in /in/3UFTh on line 7 string(1) "b" bool(false) Warning: Illegal string offset 'x' in /in/3UFTh on line 10 string(1) "a" bool(false) Notice: A non well formed numeric value encountered in /in/3UFTh on line 13 string(1) "b" bool(false)
Output for hhvm-3.10.0 - 3.12.0
string(1) "b" bool(true) string(1) "b" bool(false) string(1) "a" bool(false) string(1) "b" bool(false)
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.3.29
string(1) "b" bool(true) string(1) "b" bool(true) string(1) "a" bool(true) string(1) "b" bool(true)
Output for 5.0.0 - 5.0.2
string(1) "b" bool(false) string(1) "b" bool(false) string(1) "a" bool(false) string(1) "b" bool(false)