3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $nullvar[0]['a']= ''; if (isset($nullvar[0]['a']['r'])) { echo "set"; } else { echo "not set"; } if (is_null($nullvar[0]['a']['r'])) { echo "\nnull"; } else { echo "\nnot null"; }
Output for 5.4.0 - 5.6.21, 7.0.0 - 7.1.0
not set Warning: Illegal string offset 'r' in /in/sgnqd on line 12 Notice: Uninitialized string offset: 0 in /in/sgnqd on line 12 not null
Output for hhvm-3.10.0 - 3.12.0
not set not null
Output for 5.2.10 - 5.3.29
not set Notice: Uninitialized string offset: 0 in /in/sgnqd on line 12 not null
Output for 4.3.3 - 5.2.9
not set Notice: Uninitialized string offset: 0 in /in/sgnqd on line 12 not null
Output for 4.3.0 - 4.3.2
Notice: Uninitialized string offset: 0 in /in/sgnqd on line 6 not set Notice: Uninitialized string offset: 0 in /in/sgnqd on line 12 not null