1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/reflection/tests/ReflectionClass_toString_007.phpt
2023-04-16 22:20:26 +02:00

21 lines
386 B
PHP

--TEST--
Using ReflectionClass::__toString() with typed class constants when there is a type mismatch
--FILE--
<?php
class Foo {
const array CONST1 = C;
}
define("C", new stdClass());
try {
(string) new ReflectionClass(Foo::class);
} catch (TypeError $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
Cannot assign stdClass to class constant Foo::CONST1 of type array