xref: /PHP-7.2/ext/libxml/tests/bug54138_2.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 (LIBXML_VERSION < 20900) die('skip this test is for libxml >= 2.9.0 only');
7if (defined('LIBXML_BIGLINES')) die('skip this test is for LIBXML_BIGLINES being undefined');
8?>
9--FILE--
10<?php
11define('LIBXML_BIGLINES', 1<<22);
12$foos = str_repeat('<foo/>' . PHP_EOL, 65535);
13$xml = <<<XML
14<?xml version="1.0" encoding="UTF-8"?>
15<root>
16$foos
17<bar/>
18</root>
19XML;
20$dom = new DOMDocument();
21$dom->loadXML($xml, LIBXML_BIGLINES);
22var_dump($dom->getElementsByTagName('bar')->item(0)->getLineNo());
23?>
24--EXPECT--
25int(65540)
26