xref: /php-src/ext/libxml/tests/bug54138_2.phpt (revision 74859783)
1--TEST--
2Bug #54138 - DOMNode::getLineNo() doesn't return line number higher than 65535
3--EXTENSIONS--
4dom
5--SKIPIF--
6<?php
7if (LIBXML_VERSION < 20900) die('skip this test is for libxml >= 2.9.0 only');
8if (defined('LIBXML_BIGLINES')) die('skip this test is for LIBXML_BIGLINES being undefined');
9?>
10--FILE--
11<?php
12define('LIBXML_BIGLINES', 1<<22);
13$foos = str_repeat('<foo/>' . PHP_EOL, 65535);
14$xml = <<<XML
15<?xml version="1.0" encoding="UTF-8"?>
16<root>
17$foos
18<bar/>
19</root>
20XML;
21$dom = new DOMDocument();
22$dom->loadXML($xml, LIBXML_BIGLINES);
23var_dump($dom->getElementsByTagName('bar')->item(0)->getLineNo());
24?>
25--EXPECT--
26int(65540)
27