Differences
This shows you the differences between two versions of the page.
| |
rfc:typed_constants [2023/01/25 09:13] – created kocsismate | rfc:typed_constants [2023/01/25 20:24] (current) – kocsismate |
---|
</code> | </code> |
| |
''getType()'' returns a ''ReflectionType'' if the class constant has a type, and null otherwise. | * ''getType()'' returns a ''ReflectionType'' if the class constant has a type, and null otherwise. |
''hasType()'' returns ''true'' if the class constant has a type, and false otherwise. The behavior matches that of ''getType()''/''hasType()'' for parameters/properties and ''getReturnType()''/''hasReturnType()'' for return types. | * ''hasType()'' returns ''true'' if the class constant has a type, and false otherwise. The behavior matches that of ''getType()''/''hasType()'' for parameters/properties and ''getReturnType()''/''hasReturnType()'' for return types. |
| |
Additionally, a new ''ReflectionGlobalConstant'' class is added: | Additionally, a new ''ReflectionGlobalConstant'' class is added: |
| |
| <code php> |
class ReflectionConstant implements Reflector { | class ReflectionConstant implements Reflector { |
public string $name; | public string $name; |
| |
Both votes require 2/3 majority. | Both votes require 2/3 majority. |
| |
| ==== Vote #1 ==== |
| |
<doodle title="Add support for typed class constants?" auth="kocsismate" voteType="single" closed="true"> | <doodle title="Add support for typed class constants?" auth="kocsismate" voteType="single" closed="true"> |
</doodle> | </doodle> |
| |
| ==== Vote #2 ==== |
| |
<doodle title="Add support for typed global constants?" auth="kocsismate" voteType="single" closed="true"> | <doodle title="Add support for typed global constants?" auth="kocsismate" voteType="single" closed="true"> |