Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106832 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94387 invoked from network); 2 Sep 2019 18:29:19 -0000 Received: from unknown (HELO mail.gna.ch) (62.12.172.119) by pb1.pair.com with SMTP; 2 Sep 2019 18:29:19 -0000 Received: from [10.183.2.190] (unknown [217.192.174.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 6501C20BD0; Mon, 2 Sep 2019 18:02:45 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Mon, 2 Sep 2019 18:02:44 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Dan Ackroyd X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] Mixed mode methods From: cschneid@cschneid.com (Christian Schneider) Am 02.09.2019 um 17:01 schrieb Dan Ackroyd : > 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. >=20 > class Foo { > static function loadXml() { > echo "I am static method\n"; > } >=20 > 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