mirror of
https://github.com/php/php-src.git
synced 2026-04-24 16:38:25 +02:00
15813d69a5
We should only return the override if the internal static method is matched. Closes GH-14194.
25 lines
456 B
PHP
25 lines
456 B
PHP
--TEST--
|
|
GH-14183 (XMLReader::open() can't be overridden)
|
|
--EXTENSIONS--
|
|
xmlreader
|
|
--FILE--
|
|
<?php
|
|
class MyXMLReader extends XMLReader
|
|
{
|
|
public static function open(string $uri, string $encoding = null, int $flags = 0): bool|\XMLReader
|
|
{
|
|
echo 'overridden', PHP_EOL;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
var_dump(MyXMLReader::open('asdf'));
|
|
$o = new MyXMLReader;
|
|
var_dump($o->open('asdf'));
|
|
?>
|
|
--EXPECT--
|
|
overridden
|
|
bool(true)
|
|
overridden
|
|
bool(true)
|