Am 02.09.2019 um 17:01 schrieb Dan Ackroyd <dan...@basereality.com>: > Also(, without checking to see if it's feasible,) to me a less > surprising approach would be to allow static and instance methods to > be declared separately with the same method name. > > class Foo { > static function loadXml() { > echo "I am static method\n"; > } > > function loadXml() { > echo "I am instance method\n"; > } > }
I was considering this approach but that is a special case of Ad hoc polymorphism (https://en.wikipedia.org/wiki/Ad_hoc_polymorphism). And that's a path I don't want to go down, I don't think that's a good fit for PHP. It felt more natural to model it similarly to nullable return types. - Chris -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php