Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74444 invoked from network); 6 Jun 2016 10:57:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2016 10:57:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:38069] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/42-60933-60755575 for ; Mon, 06 Jun 2016 06:57:11 -0400 Received: by mail-wm0-f52.google.com with SMTP id m124so66792905wme.1 for ; Mon, 06 Jun 2016 03:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=ahFau5n4PyWQ6oEmJBboQld0nnPyLDDs9MeAFEuYiY8=; b=vs1x9OXf1Tr2OD2roN5y40oJOCIpEWcrlQInsrpT2Yjgy6FvbwkmjP6UP3omSip4// rQWdKMSK6KVzxPDJBqcMDfo+8SMqxjwN20gwILvcrXPuMJ+pzsBtajZUfyv1DxJ3cGsA JmJks3AAwK0nhqM4hSXcAv+AjPLkkI0iZ9nW+QoyEmI5icyuEZT3CjB4DlgE0A6qButA GmYoTEdLr4/37ECe2domQxJE569xMIaMuK6lJaWrkrUUzy1ZIN5cMi7yKZkJEuOGJAp2 +l0wfW7HSp0NlNsEwGrwHLlW3/rR3vKSf1EOXVZsmhGmWjnAuqJVgFc2ECoMwn6ERq/g WZBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ahFau5n4PyWQ6oEmJBboQld0nnPyLDDs9MeAFEuYiY8=; b=mtNdpo11YUB3qqI/6GEvj96oskHk2q6pq86/Mb1/FycTOo1q+4tXiDVKtukfNAzH4B 8+JGWZucsP9Oj4JjlmgRAZ5F3U+sC9Ygsz1SuovSPcV/qPRI0g4kX3FAsnUUxrRrCxVw hBy49it6/8tjjPhzVKKLTS/12B3H979WXk8hMs8TPE3v7V4/kmFp7zw3Jjm9OofETBGp R4B8ljyDIITPgaTffToAzTivoNXXEzv7sdYbcMN31yG3kASoCuHVpmaxsQUJMLnvUEhJ Jte8kj8nD8gPuUclXGu0D0Q4Sx34W2xSebCoEsZUhUEr9cabFtOWH1hp9EoI3MpbPLc5 sfWg== X-Gm-Message-State: ALyK8tLhSqFRLQ6yg7rUcpuG+THE6q2rDcu7HRK8rQDCxPSoSLUtpjN5XRwoPpY9t1vshA== X-Received: by 10.194.153.65 with SMTP id ve1mr14932584wjb.106.1465210627489; Mon, 06 Jun 2016 03:57:07 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id t1sm19687087wjy.3.2016.06.06.03.57.06 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 03:57:06 -0700 (PDT) To: internals@lists.php.net References: <8b3055e5-706d-ae5e-bbe6-de6ba292ca5b@gmx.de> Message-ID: <9b9b33c0-03ff-c147-5105-e4f02901ce6e@gmail.com> Date: Mon, 6 Jun 2016 11:55:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <8b3055e5-706d-ae5e-bbe6-de6ba292ca5b@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Opinion on function/method name overloading From: rowan.collins@gmail.com (Rowan Collins) On 06/06/2016 11:32, Christoph Becker wrote: > And we would run into similar issues as with the union types with regard > to weak typing. This is probably the biggest hurdle, IMO - regardless of the internal implementation, you've got to define exactly how the feature would work in the language itself. A quick example off the top of my head (there are many other edge cases to cover): class A { public function foo($bar) { echo 0; } public function foo(string $bar) { echo 1; } public function foo(int $bar) { echo 2; } } class B extends A { public function foo(float $bar) { echo 3; } } (new A)->foo(1.5); (new B)->foo(1.5); Regards, -- Rowan Collins [IMSoP]