xref: /PHP-8.4/ext/simplexml/tests/gh12167.phpt (revision 82a84d0b)
1--TEST--
2GH-12167 (Unable to get processing instruction contents in SimpleXML)
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7
8$xml = <<<XML
9<?xml version="1.0"?>
10<container>
11  <?foo pi contents ?>
12</container>
13XML;
14
15$sxe = simplexml_load_string($xml);
16
17var_dump($sxe->xpath("//processing-instruction()")[0]->getName());
18var_dump((string) $sxe->xpath("//processing-instruction()")[0]);
19
20?>
21--EXPECT--
22string(3) "foo"
23string(12) "pi contents "
24