xref: /PHP-8.0/ext/simplexml/tests/021.phpt (revision f8d79582)
1--TEST--
2SimpleXML: Element check
3--SKIPIF--
4<?php if (!extension_loaded("simplexml")) print "skip"; ?>
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