Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
PHP
/
Traits
A service must accept any object that can produce a reference, whether or not it uses For…
from Traits
PHP 8.3.33
beginner
1 min
A service must accept any object that can produce a reference, whether or not it uses FormatsReference. What should its parameter require?
A Referenceable interface implemented by each accepted class
The FormatsReference trait name as the parameter type
ReflectionClass::getTraits() at every call site
A common parent class used only to share the formatter
Check
Ask AI about this kata
Report an error
previous kata
Can insteadof resolve a same-named property declared by a trait and its consuming class?
Quiz
next kata
On PHP 8.3, when does a child get static trait storage distinct from the parent shown in …
Quiz
A new version is available
Reload