Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82885 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30572 invoked from network); 16 Feb 2015 20:50:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2015 20:50:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:42875] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/AE-36518-A1852E45 for ; Mon, 16 Feb 2015 15:50:34 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id D278B4B025A; Mon, 16 Feb 2015 21:50:15 +0100 (CET) Reply-To: To: =?utf-8?Q?'Pavel_Kou=C5=99il'?= Cc: "'Arvids Godjuks'" , "'Jefferson Gonzalez'" , "'Rowan Collins'" , "'PHP internals'" References: <011801d04a07$83ab1c00$8b015400$@php.net> In-Reply-To: Date: Mon, 16 Feb 2015 21:50:28 +0100 Message-ID: <015a01d04a2a$329ce7d0$97d6b770$@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGD0sLDaA+/0NIeBlQhQC5OtPA/xwHyN1EInX0bEaA= Content-Language: fr X-Antivirus: avast! (VPS 150216-0, 16/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Reviving scalar type hints From: francois@php.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) > De : Pavel Kouril [mailto:pajousek@gmail.com] > > Hello, >=20 > I know this is probably a pretty unpopular opinion in PHP (based on > the replies I got in the other thread), but different values for > parameters should be IMHO solved by method overloading and such. The question is not that it's unpopular, it's that 1. It requires strict = types, and 2. If we want to solve this by polymorphism, we must also = support polymorphism on functions. Now, tell me how you would solve the = tan(int|float) case with polymorphism ? One 'tan' function for int, one = for float ? str_replace(string|array, string|array, string|array, int &) = is also a nice case to study if you can't sleep... Sorry but polymorphism on scalar types is possible with strict types = only, which is out of scope for the next RFC. Fran=C3=A7ois