mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
This no longer caught the case where an non SplFileInfo/inherited class of nwas passed since the refactoring in 8.4. close GH-17517
25 lines
634 B
PHP
25 lines
634 B
PHP
--TEST--
|
|
GH-17516 SplTempFileObject::getPathInfo() crashes on invalid class ID.
|
|
--FILE--
|
|
<?php
|
|
$cls = new SplTempFileObject();
|
|
class SplFileInfoChild extends SplFileInfo {}
|
|
class BadSplFileInfo {}
|
|
|
|
var_dump($cls->getPathInfo('SplFileInfoChild'));
|
|
|
|
try {
|
|
$cls->getPathInfo('BadSplFileInfo');
|
|
} catch (\TypeError $e) {
|
|
echo $e->getMessage();
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
object(SplFileInfoChild)#2 (2) {
|
|
["pathName":"SplFileInfo":private]=>
|
|
string(4) "php:"
|
|
["fileName":"SplFileInfo":private]=>
|
|
string(4) "php:"
|
|
}
|
|
SplFileInfo::getPathInfo(): Argument #1 ($class) must be a class name derived from SplFileInfo or null, BadSplFileInfo given
|