xref: /php-src/ext/xmlreader/tests/gh14183.phpt (revision d934840f)
1--TEST--
2GH-14183 (XMLReader::open() can't be overridden)
3--EXTENSIONS--
4xmlreader
5--FILE--
6<?php
7class MyXMLReader extends XMLReader
8{
9    public static function open(string $uri, ?string $encoding = null, int $flags = 0): bool|\XMLReader
10    {
11        echo 'overridden', PHP_EOL;
12        return true;
13    }
14}
15
16var_dump(MyXMLReader::open('asdf'));
17$o = new MyXMLReader;
18var_dump($o->open('asdf'));
19?>
20--EXPECT--
21overridden
22bool(true)
23overridden
24bool(true)
25