3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $nullvar = array(0 => 'a', 'a' => array('b')); $nullvar[0]['a'] = NULL; if (isset($nullvar[0]['a'])) { echo "set"; } else { echo "not set"; } if (is_null($nullvar[0]['a'])) { echo "\nnull"; } else { echo "\nnot null"; }
Output for 7.1.0
Warning: Illegal string offset 'a' in /in/spm3N on line 4 Warning: Cannot assign an empty string to a string offset in /in/spm3N on line 4 not set Warning: Illegal string offset 'a' in /in/spm3N on line 11 not null
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.0.14
Warning: Illegal string offset 'a' in /in/spm3N on line 4 not set Warning: Illegal string offset 'a' in /in/spm3N on line 11 not null
Output for 5.0.0 - 5.0.2, hhvm-3.10.0 - 3.12.0
not set not null
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.3.29
set not null