Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82597 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84025 invoked from network); 13 Feb 2015 11:07:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2015 11:07:54 -0000 Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.52 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.216.52 mail-qa0-f52.google.com Received: from [209.85.216.52] ([209.85.216.52:48030] helo=mail-qa0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/14-62214-A0BDDD45 for ; Fri, 13 Feb 2015 06:07:54 -0500 Received: by mail-qa0-f52.google.com with SMTP id v10so11872295qac.11 for ; Fri, 13 Feb 2015 03:07:52 -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:content-transfer-encoding; bh=XspH+OHPffK50k+GNpw6WP6j7evVDL8Yx41x6KnH3ew=; b=jKIRC6Uv7K8YxaOZYjJkTfbjFCZCTUUMJgtgcCs3MwGQtXsYaOJMkoqbn3ioACg1Zu FaICeq4dK6f4N76uT09VPDYo2LRWFAcxyHt6xKwWLmifNoiM9lGH+j2WOtJLTjyHxFgj Z+38DhQ/fhTcVxDsV2EzNF0Be/lNWlhGUb8WOzJF+EeKcJuH5NhwdJcuXS5iCWjlOcLR Y8pirGsV+EjDnPeoIXsVLydmwnrXljTUS0aUovMStoSAi61tNrtkfUvHTB/va5WFK/7t YMGObsJy/iJ+wQ7i7a5eEBz4MgNsUrU7Yd+14WwAKS6Weuj6WxdFqsSrn5UECQDJHb99 njlw== MIME-Version: 1.0 X-Received: by 10.140.23.199 with SMTP id 65mr21772355qgp.84.1423825672182; Fri, 13 Feb 2015 03:07:52 -0800 (PST) Received: by 10.96.66.201 with HTTP; Fri, 13 Feb 2015 03:07:52 -0800 (PST) In-Reply-To: <008801d046e5$89edc2e0$9dc948a0$@tekwire.net> 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> <007b01d046df$1bde01d0$539a0570$@tutteli.ch> <008801d046e5$89edc2e0$9dc948a0$@tekwire.net> Date: Fri, 13 Feb 2015 12:07:52 +0100 Message-ID: To: francois@tekwire.net Cc: Robert Stoll , Nikita Nefedov , Andrea Faulds , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Thu, Feb 12, 2015 at 6:01 PM, Fran=C3=A7ois Laupretre wrote: > Hi Robert, > >> De : Robert Stoll [mailto:php@tutteli.ch] >> >> There are several programming languages which do support dynamic typing >> and method overloading somehow (Clojure, Erlang, Prolog, Cecil and >> certainly more). Most of them use a multi-method approach and I think i= f >> PHP would introduce function/method overloading, then such an approach >> would be appropriate. Right now, I need to implement the dynamic >> dispatching quasi myself which might be more verbose but is also more >> cumbersome (and uglier IMO). Consider the following (fictional example): > > We all agree on the interest of polymorphism on object classes, even if y= our example could be solved with specialized logger classes, but the questi= on was about polymorphism on different scalar types, which is much more pro= blematic in PHP, even using strict scalar typing. > > Cheers > > Fran=C3=A7ois > Hello, actually, I was speaking about method overloading in general, for both scalars and objects. Also, I don't see the problems with scalar method overloading problem with either weak or strict typing. Could you expand that thought, please? Regards Pavel Kou=C5=99il