Self-obfuscating value objects in PHP
eric.mann.blog
eric.mann.blog
There is a way, but it's dangerous: https://www.php.net/manual/en/function.runkit7-function-rede...
> an interface, which cannot implement or inherit from other interfaces
An interface in PHP most definitely can extend multiple other interfaces.Value objects may be great for leveraging the type system to help you write better code by e.g. having only one place for validation. But why should you pass scalar variables by reference? That makes it really hard to reason about what functions and methods do.