RFC: https://wiki.php.net/rfc/typed_class_constants Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com> Co-Authored-By: Bob Weinand <3154871+bwoebi@users.noreply.github.com> Co-Authored-By: Ilija Tovilo <ilija.tovilo@me.com>
33 lines
406 B
PHP
33 lines
406 B
PHP
--TEST--
|
|
Using ReflectionClass::__toString() with typed class constants
|
|
--FILE--
|
|
<?php
|
|
|
|
class Foo {
|
|
const ?int CONST1 = 1;
|
|
}
|
|
|
|
echo new ReflectionClass(Foo::class);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Class [ <user> class Foo ] {
|
|
@@ %s 3-5
|
|
|
|
- Constants [1] {
|
|
Constant [ public ?int CONST1 ] { 1 }
|
|
}
|
|
|
|
- Static properties [0] {
|
|
}
|
|
|
|
- Static methods [0] {
|
|
}
|
|
|
|
- Properties [0] {
|
|
}
|
|
|
|
- Methods [0] {
|
|
}
|
|
}
|