Skip to content
Advertisement

Tag: union-types

PHP Union Types with default value

I wanted to implement methods with union-type dependencies for the argument like so: but it’s triggering an error I looked through the documentation but there is no mention of this. Thanks in advance Answer You can add new type for other type hint:

Advertisement