3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test_isset($str) { $xml = '<field Default="' . $str . '"/>'; $field = new SimpleXmlElement($xml); var_dump(isset($field)); var_dump(isset($field['Default'])); var_dump(isset($field['XXX'])); } test_isset(""); test_isset("No"); test_isset("Yes"); test_isset("NULL"); test_isset("0"); test_isset("1"); test_isset("20");
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) bool(true) bool(false) bool(true) bool(true) bool(false) bool(true) bool(true) bool(false) bool(true) bool(true) bool(false) bool(true) bool(true) bool(false) bool(true) bool(true) bool(false) bool(true) bool(true) bool(false)
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/7M075 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/7M075 on line 4