Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82540 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94105 invoked from network); 12 Feb 2015 14:54:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 14:54:33 -0000 Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.51 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.218.51 mail-oi0-f51.google.com Received: from [209.85.218.51] ([209.85.218.51:65499] helo=mail-oi0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/28-50473-6AEBCD45 for ; Thu, 12 Feb 2015 09:54:32 -0500 Received: by mail-oi0-f51.google.com with SMTP id g201so3507350oib.10 for ; Thu, 12 Feb 2015 06:54:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mO3K9MVPMj5MVJxerBVlqrD1oXLMqzjcHRxHpthGgQA=; b=Hz+oHIBg0kCphez2u0nF71tO35SOJntp40Ql52HxlV7hTjcXOy8rIDISL1JotHRHNF sU2xF26ZYbvee7qCBlT41pZeXH9GbbY4HP1+8lQ4yBmbVdH6deFZ+FZ8m8/9grSnF+Ae RDJj38HO68nj+BnYegB3OSue5tKr1qbvViGLasmFBYq08Yg90r/uiSRjuAGHe8xCWen7 5oqp51azcyeZD9DqaAn+j5zmOWksXGwm5bH4XW/vUba62msxnh32zMccDuFLIDYJX7xY rZfIXq2U3L0BCnuZ1BAJqkMexqDU14oGmmMPWCL2ZuVqkm8s8ZOR8+s6neMoDpdA00fy 6H7Q== MIME-Version: 1.0 X-Received: by 10.182.65.97 with SMTP id w1mr2970427obs.73.1423752867585; Thu, 12 Feb 2015 06:54:27 -0800 (PST) Received: by 10.202.59.10 with HTTP; Thu, 12 Feb 2015 06:54:27 -0800 (PST) In-Reply-To: <342635C4-F0EA-4557-A37F-753E51100402@ajf.me> References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> <54DAF884.7000508@lerdorf.com> <203e611c8e0b03568a868b8d931aec37@mail.gmail.com> <61E01A7C-C5C8-447F-A8FA-E12A18E847CA@ajf.me> <85D76C91-9A9E-459B-847A-619AA21B9262@ajf.me> <342635C4-F0EA-4557-A37F-753E51100402@ajf.me> Date: Thu, 12 Feb 2015 18:54:27 +0400 Message-ID: To: Andrea Faulds Cc: =?UTF-8?Q?Pavel_Kou=C5=99il?= , PHP Internals Content-Type: multipart/alternative; boundary=089e015387d4eba42d050ee54ba6 Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints From: inefedor@gmail.com (Nikita Nefedov) --089e015387d4eba42d050ee54ba6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, 2015-02-12 18:31 GMT+04:00 Andrea Faulds : > Hi Pavel, > > > On 12 Feb 2015, at 13:48, Pavel Kou=C5=99il wrote: > > > > C# does have dynamic typing. > > No it doesn=E2=80=99t, it=E2=80=99s a statically-typed language. I don=E2= =80=99t understand why > you say it has dynamic typing - there is some limited dynamism in parts, > but I don=E2=80=99t think it affects what we=E2=80=99re talking about. Dy= namic typing and > polymorphism aren=E2=80=99t the same. > C# actually supports dynamic typing with a dynamic keyword [1]. But it really doesn't mean that having method overloading in a dynamic language is a good idea... C#, although it has a full ability to support dynamic typing, is not usually used in this fashion. To understand why it's not the best idea to use dynamic types with overloading you can just google "C# dynamic type with overloading site:stackoverflow.com". Another great deal in this question is performance, I think this subject was brought up a plenty of times in this ML and it was pointed out a couple of times that overloading even if doable at some point, would harm performance of method calls, which are already one of the slowest (if not the slowest) OPs in the engine. Languages like C# are usually able to resolve method references at compile time (unless virtual methods are used, even then it's only a matter of choosing right method from hierarchy not from all the overloaded variants). [1] https://msdn.microsoft.com/en-us/library/dd264736.aspx --089e015387d4eba42d050ee54ba6--