xref: /PHP-7.4/ext/libxml/tests/bug54138.phpt (revision a1951c2e)
1--TEST--
2Bug #54138 - DOMNode::getLineNo() doesn't return line number higher than 65535
3--SKIPIF--
4<?php
5if (!extension_loaded('dom')) die('skip dom extension not available');
6if (!defined('LIBXML_BIGLINES')) die('skip this test requires LIBXML_BIGLINES');
7?>
8--FILE--
9<?php
10$foos = str_repeat('<foo/>' . PHP_EOL, 65535);
11$xml = <<<XML
12<?xml version="1.0" encoding="UTF-8"?>
13<root>
14$foos
15<bar/>
16</root>
17XML;
18$dom = new DOMDocument();
19$dom->loadXML($xml, LIBXML_BIGLINES);
20var_dump($dom->getElementsByTagName('bar')->item(0)->getLineNo());
21?>
22--EXPECT--
23int(65540)
24