Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37053 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29826 invoked from network); 17 Apr 2008 09:34:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 09:34:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=luckyluke56@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=luckyluke56@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.46.28 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: luckyluke56@gmail.com X-Host-Fingerprint: 74.125.46.28 yw-out-2324.google.com Received: from [74.125.46.28] ([74.125.46.28:58696] helo=yw-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/F8-03488-EA917084 for ; Thu, 17 Apr 2008 05:34:39 -0400 Received: by yw-out-2324.google.com with SMTP id 5so1458805ywb.83 for ; Thu, 17 Apr 2008 02:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=XS9Sh6TG3T8bntKU20T/JAc/f205nqyOmAaS5a2QavI=; b=N7Olqw4zu8MPvSPlUa9E1aNX4URx29AAqvGeeDHpV3io3jYoxNc4FVlC06zBeFqj5rU/fJlyfZ+P6duf/1jvBe/5iz61ePjIPIZzVcDdQ1GZmYdE0QTCMtEmPyN0caWsB+D4cflZcUdZIrA6K+k9GGObmk1xo/fTZtVZikOcJ7c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=MOH4W18ohWX43agm2+wp2cqMW3ClG1rPckhz0GobQ4VX327QXwj/AZvKIfAOyLWwfi0kEDfrFznE3caPGi9QmiwUG14M/u5AKmzVmSZD8YWlracNDm5q/mfpQ68GHa6avCJICNSWt5WwN1vETfxBxanO/rKh2qsyazsO2G1cpDU= Received: by 10.150.196.5 with SMTP id t5mr1347823ybf.109.1208424872318; Thu, 17 Apr 2008 02:34:32 -0700 (PDT) Received: by 10.150.148.5 with HTTP; Thu, 17 Apr 2008 02:34:32 -0700 (PDT) Message-ID: <75176a5d0804170234m5f504de6k93cf850e63b75f15@mail.gmail.com> Date: Thu, 17 Apr 2008 11:34:32 +0200 To: "Arvids Godjuks" Cc: "Felipe Pena" , internals@lists.php.net In-Reply-To: <9b3df6a50804170201v2a59d260u824670b86a70db7a@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9177_12433156.1208424872318" References: <1208404255.5665.34.camel@pena> <9b3df6a50804170201v2a59d260u824670b86a70db7a@mail.gmail.com> Subject: Re: [PHP-DEV] [RFC] Type hints (parameter and return value) From: luckyluke56@gmail.com ("Lucas van Dijk") ------=_Part_9177_12433156.1208424872318 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Array is already built in, and for mixed, as you already mentioned, indeed no type hinting. I definitely want this implemented, +1 from me. On Thu, Apr 17, 2008 at 11:01 AM, Arvids Godjuks wrote: > What about types like > array > mixed > > Ok, for "mixed" we may not use type hinting at all - does patch allow to > hint only part of function args? > If we have a function, witch takes as 1st argument array or string and > other > args should have strict types or just use call like myFunc(Array($string), > .....) ? This is just to know this for sure. > > 2008/4/17, Felipe Pena : > > > > Hello again! > > > > Now with both parameter and return value type hints. > > > > For parameter type hints, i have completed the actual implementation > > with the leftover php types: > > - string (binary string and unicode) > > - integer (accepting numeric string too) > > - double (accepting numeric string too) > > - boolean ('0', '1', true, false) > > - resource > > - object > > > > (Yes, following our dynamic typing) > > > > > > Since then, the patch also includes new methods to Reflection: > > - isInt() > > - isDouble() > > - isBool() > > - isString() > > - isObject() > > - isResource() > > > > > > And for return value, i have modified and improved the previous patch, > > and now it is using only the "(type)" notation. Hence, that > > implementation doesn't make any BC break. > > > > > > Examples, patches and tests: http://wiki.php.net/rfc/typehint > > > > > > Thanks. > > > > -- > > Regards, > > Felipe Pena. > > > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- Lucas ------=_Part_9177_12433156.1208424872318--