3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = []; $a['aaaa']['mode'] = 'test'; $a['b'] = false; $a['c'] = ''; $a['d'] = 0; $a['e'] = new \stdClass(); $a['f'] = null; var_dump('isset'); var_dump(isset($a['a'])); var_dump(isset($a['b'])); var_dump(isset($a['c'])); var_dump(isset($a['d'])); var_dump(isset($a['e'])); var_dump(isset($a['f'])); var_dump('empty'); var_dump(empty($a['a'])); var_dump(empty($a['b'])); var_dump(empty($a['c'])); var_dump(empty($a['d'])); var_dump(empty($a['e'])); var_dump(empty($a['f']));
Output for 5.4.0 - 7.1.0
string(5) "isset" bool(false) bool(true) bool(true) bool(true) bool(true) bool(false) string(5) "empty" bool(true) bool(true) bool(true) bool(true) bool(false) bool(true)
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/hK0db on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/hK0db on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/hK0db on line 2
Process exited with code 255.