mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
24 lines
408 B
PHP
24 lines
408 B
PHP
--TEST--
|
|
GH-12169 (Unable to get comment contents in SimpleXML)
|
|
--EXTENSIONS--
|
|
simplexml
|
|
--FILE--
|
|
<?php
|
|
|
|
$xml = <<<XML
|
|
<?xml version="1.0"?>
|
|
<container>
|
|
<!-- comment contents -->
|
|
</container>
|
|
XML;
|
|
|
|
$sxe = simplexml_load_string($xml);
|
|
|
|
var_dump($sxe->xpath("//comment()")[0]->getName());
|
|
var_dump((string) $sxe->xpath("//comment()")[0]);
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(7) "comment"
|
|
string(18) " comment contents "
|