Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44609 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65400 invoked from network); 1 Jul 2009 21:08:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jul 2009 21:08:07 -0000 Authentication-Results: pb1.pair.com header.from=paul.biggar@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=paul.biggar@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: paul.biggar@gmail.com X-Host-Fingerprint: 209.85.219.227 mail-ew0-f227.google.com Received: from [209.85.219.227] ([209.85.219.227:38034] helo=mail-ew0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/B4-43450-730DB4A4 for ; Wed, 01 Jul 2009 17:08:07 -0400 Received: by ewy27 with SMTP id 27so1358613ewy.23 for ; Wed, 01 Jul 2009 14:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=UxEqiHcBFX7T7tnIdwvVYx1hku767Mtzy2IEKRnKdoA=; b=kKsdkDn1QjLpCte9AQLNYHVFOpaIrnVvfcWPiRt+0Wr0J+QRhux5JDG3O3br4uOCun NzVsGtUU2sXXQ7xUeU4+WzG6gRb6xUqfDnjX+g/hy+cbfFmevR78tMeXMKpKjzDC5i5v H7aPlxmGp2dsb43CZSgE3gdH5mcJkXVZAgG3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=X/husZ4XUMXoETNb0JZP0JnJICrUSxw7Yrge9x532pKxQ1BXmFOjH9v4sOZ7owXg/a F6qT8K6YPA/QL+FE9c3iQ7mrsEJD/PSUqYb+hH5V9MA2L4NHXIwtOxOd7EZKETP79Xg/ z6nTiLQ7fid+6gZU0zHsefNhkh9PELZEBrLro= MIME-Version: 1.0 Received: by 10.210.89.7 with SMTP id m7mr5941470ebb.92.1246482484198; Wed, 01 Jul 2009 14:08:04 -0700 (PDT) In-Reply-To: <7f3ed2c30907011402taa51848h56dfff924c59a6cb@mail.gmail.com> References: <4A4BA5C8.1020204@zend.com> <4A4BAE7B.3020601@zend.com> <39D0B97E-3A70-44E3-B1BC-D68A0E58CA76@prohost.org> <4A4BC731.1020909@zend.com> <7f3ed2c30907011342y24ccd2c7te5f7c273f001fa7a@mail.gmail.com> <4A4BCC0D.6000704@zend.com> <7f3ed2c30907011402taa51848h56dfff924c59a6cb@mail.gmail.com> Date: Wed, 1 Jul 2009 22:07:44 +0100 Message-ID: To: Hannes Magnusson Cc: Stanislav Malyshev , Ilia Alshanetsky , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3 From: paul.biggar@gmail.com (Paul Biggar) On Wed, Jul 1, 2009 at 10:02 PM, Hannes Magnusson wrote: > On Wed, Jul 1, 2009 at 22:50, Stanislav Malyshev wrote: >> No, internal typehint doesn't work the way "int" typehint works with thi= s >> patch. Internal typehint (zend_parse_parameters) do conversions, see > > You are wrong. Internal type hinting is done in the form of argument > information. > Those are identical to the userspace type hinting. > > ZEND_BEGIN_ARG_INFO(arginfo_foo, 0) > =C2=A0 =C2=A0ZEND_ARG_OBJ_INFO(0, MyClass, argumentName, 0) > ZEND_END_ARG_INFO(); > > is the same as the userspace form of: > > function foo(MyClass $argumentName) {} > > The current patch is missing a ZEND_ARG_STRING_INFO(0, argumentName, > 0) which would be the same as > fnuction foo(string $argumentName){} > If that is the onlything you are worrying about then thats easily fixed. > > > zend_parse_parameters(... abcdefg) > is the same as > function($a, $b, $c..) { $a =3D (int) $a; $b =3D (string) $b; $c =3D (arr= ay) $c...} So, what you're saying is, the patch already handles coercion? If that's the case, then problem solved. (But I didnt think it did.) Thanks, Paul --=20 Paul Biggar paul.biggar@gmail.com