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