3v4l.org

run code in 200+ 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 - 7.2.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 - 7.0.20
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 4.3.0 - 4.4.9, 5.0.3 - 5.3.29
set not null
Output for 5.0.0 - 5.0.2
not set not null