summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests/bug46003.phpt
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2008-09-10 16:28:20 +0000
committerRob Richards <rrichards@php.net>2008-09-10 16:28:20 +0000
commitda5e36b7029959ea6f6a4794e6c2196d0e5a1f0d (patch)
tree3e4b02a071527e348fec8b9ac3770ecd8b1edc77 /ext/simplexml/tests/bug46003.phpt
parente362e663756fc9497b054a6cd20a3380c32abab1 (diff)
downloadphp-git-da5e36b7029959ea6f6a4794e6c2196d0e5a1f0d.tar.gz
fix bug #46003 (isset on nonexisting node return unexpected results)
add test
Diffstat (limited to 'ext/simplexml/tests/bug46003.phpt')
-rw-r--r--ext/simplexml/tests/bug46003.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/simplexml/tests/bug46003.phpt b/ext/simplexml/tests/bug46003.phpt
new file mode 100644
index 0000000000..a10b018725
--- /dev/null
+++ b/ext/simplexml/tests/bug46003.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #46003 (isset on nonexisting nodes return unexpected results)
+--FILE--
+<?php
+$xml =<<<XML
+<r>
+ <p>Test</p>
+ <o d='h'>
+ <xx rr='info' />
+ <yy rr='data' />
+ </o>
+</r>
+XML;
+
+$x = simplexml_load_string($xml);
+
+var_dump(isset($x->p));
+var_dump(isset($x->p->o));
+var_dump(isset($x->o->yy));
+var_dump(isset($x->o->zz));
+var_dump(isset($x->o->text));
+var_dump(isset($x->o->xx));
+?>
+--EXPECTF--
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(false)
+bool(true) \ No newline at end of file