[php-src] Issue #22683: Reflection(Class)Constant::__toString() should not warn on NAN conversions
| From: | DanielEScherzer | Date: | Fri, 10 Jul 2026 19:32:32 +0000 |
| Subject: | [php-src] Issue #22683: Reflection(Class)Constant::__toString() should not warn on NAN conversions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252403@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/22683
Author: DanielEScherzer
```php
<?php
echo new ReflectionConstant('NAN');
class Demo {
public const MY_NAN = NAN;
}
echo new ReflectionClassConstant(Demo::class, 'MY_NAN');
```
results in:
```
Warning: unexpected NAN value was coerced to string in /in/868PE on line 3
Constant [ <persistent> float NAN ] { NAN }
Warning: unexpected NAN value was coerced to string in /in/868PE on line 9
Constant [ public float MY_NAN ] { NAN }
```
but the reflection extension shouldn't emit these warnings when the extension is responsible
for the conversion - they are emitted by the __toString() call, not the echo