/hphp/test/slow/simple_xml/isset.php
http://github.com/facebook/hiphop-php · PHP · 20 lines · 18 code · 2 blank · 0 comment · 2 complexity · c34fb292329fd8a349b6eb2966f01cf6 MD5 · raw file
- <?hh
- function test_isset($str) {
- $xml = '<field Default="' . $str . '"/>';
- $field = new SimpleXmlElement($xml);
- var_dump(isset($field));
- var_dump($field->offsetExists('Default') && $field->offsetGet('Default') !== null);
- var_dump($field->offsetExists('XXX') && $field->offsetGet('XXX') !== null);
- }
- <<__EntryPoint>>
- function main_isset() {
- test_isset("");
- test_isset("No");
- test_isset("Yes");
- test_isset("NULL");
- test_isset("0");
- test_isset("1");
- test_isset("20");
- }