Files
php-src/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt
Gina Peter Banyard ee908f5542 Zend: normalise behaviour around class name ZPP specifier (#23359)
Splitting the behavioural change of #23052 out into this and come up with something that is hopefully more sensible and consistent between fast and slow ZPP and the object or class_name Fast ZPP specifier.
2026-08-21 13:31:45 +01:00

17 lines
384 B
PHP

--TEST--
SplFileInfo::setInfoClass() throws exception for invalid class
--FILE--
<?php
$info = new SplFileInfo(__FILE__);
try {
$info->setInfoClass('stdClass');
} catch (TypeError $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
TypeError: SplFileInfo::setInfoClass(): Argument #1 ($class) must be a class name derived from SplFileInfo, "stdClass" given