Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44646 invoked from network); 14 Sep 2014 18:21:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2014 18:21:07 -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.43 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.43 mail-wg0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:59635] helo=mail-wg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B6/00-43467-29CD5145 for ; Sun, 14 Sep 2014 14:21:06 -0400 Received: by mail-wg0-f43.google.com with SMTP id x12so2922500wgg.14 for ; Sun, 14 Sep 2014 11:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=A5JMa2d5CV60Z5Uf/btPudINCeR0inmSA6xZ3s/pbGk=; b=OyeptCipRPOrhnb2I/PbsNWSIxkWMIitoDuZeWpRfUeqiDiODoZv/ne61lu6PwKu31 nvjX4Y3w2E91QiewhODLoaZvkv2gf/ucBZSfBjDdbEE2+CNMMHPbYcagNCd1tnppztaO ncQtbtf/rY0g5/dnI5nw2gLcD3YZMAenoqAOLRcpDRUHQdtP7RL5UTja50vPX7dYWskg QePJy5OTwb6Ge8FSdKFN+QKBG3Ft+hmLEeyLV135ZQ5dtc3swZFdyI90RYDO31QP34Bp +L+jdCsar5GpXKOu17uMOk84FN2Lykw1jt6ZcDpMGVpWi79QGrjlZjHpfQvjyduHcujH Kwgw== X-Received: by 10.180.10.38 with SMTP id f6mr17766812wib.30.1410718863393; Sun, 14 Sep 2014 11:21:03 -0700 (PDT) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id mc20sm9010224wic.2.2014.09.14.11.21.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Sep 2014 11:21:02 -0700 (PDT) Message-ID: <5415DC76.7070105@gmail.com> Date: Sun, 14 Sep 2014 19:20:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: <6893A97A-EC4C-4124-B804-96E2A26B953F@ajf.me> <20140914000718.GB14312@phcomp.co.uk> <3177B936-50C1-4E5D-8687-FD235C72B411@ajf.me> <54153692.7050500@sugarcrm.com> <9CE963B0-E624-4267-BC2A-0F8D1F985DAE@ajf.me> <6f2236e18c61d30b247e1c6bb2de10f1@mail.gmail.com> <8556C1E7-EDF3-47E2-9DA0-C9AB63DE56E6@ajf.me> <6E402FE8-119A-4BBB-B652-97A0DBEC8BC9@ajf.me> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [VOTE][RFC] Scalar Type Hinting with Cast From: rowan.collins@gmail.com (Rowan Collins) On 14/09/2014 17:41, Andrey Andreev wrote: >> Perhaps I should explain what an “internal function” is in PHP parlance. An internal function is one which is exposed to userland, but is implemented in C via an extension, rather than in PHP. Examples include literally every function in PHP’s documentation. > So why are we talking about "internal functions" at all? And what does > that have to do with type hints? Some of those internal functions, implemented in C, but used by userland developers every day, have type hinting built into them, and some don't. For instance, try passing a non-numeric string to mktime(). As Andrea points out, one of the big problems in this discussion is that those internal functions aren't actually consistent with one another - some of the logic is built into zned_parse_parameters, but fallback behaviour and additional checks are implemented ad hoc all over the standard library. As a userland developer, this is actually rather confusing, and I'd be interested to know what it would take to come up with some finite set of base behaviours that documented what each function would do given the "wrong" types. -- Rowan Collins [IMSoP]