xref: /PHP-8.2/ext/simplexml/tests/021.phpt (revision 7f2f0c00)
1--TEST--
2SimpleXML: Element check
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7
8$ok = 1;
9$doc = simplexml_load_string('<root><exists>foo</exists></root>');
10if(!isset($doc->exists)) {
11    $ok *= 0;
12}
13if(isset($doc->doesnotexist)) {
14    $ok *= 0;
15}
16if ($ok) {
17         print "Works\n";
18} else {
19         print "Error\n";
20}
21?>
22--EXPECT--
23Works
24