Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37052 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13108 invoked from network); 17 Apr 2008 09:01:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 09:01:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.175 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 66.249.92.175 ug-out-1314.google.com Received: from [66.249.92.175] ([66.249.92.175:11114] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/55-03488-7E117084 for ; Thu, 17 Apr 2008 05:01:28 -0400 Received: by ug-out-1314.google.com with SMTP id u40so1097283ugc.29 for ; Thu, 17 Apr 2008 02:01:25 -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=fYLRyZUYcOVoN48tGNb1Yvu+wKMC2BSlU8A9r4MAASw=; b=Eg5wRr0DMb8CP657nUH+PVc3yoaeqnuBCwNq/Af+vaGKqXoyagPSWylqxZXIvdKeAsj3Cwih1KUQhZHs9UiTzdzBB0eIzr8OXfiG8d6Fz36qARRcgkN/Di28Qt6pIqUwBj2H441usBsvqmguWFcVTPRfDbhe9jOlJ6+edudxZYk= 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=B+f4ZIZZklDd8qchlI5Qfb46ibatT1LpSn57qi0d5js8kBg4sJeYH7LIlGXgts/k0V9MT1yd4pcibu2rk95QigHYZrXBv//FvlTVV1ciVB+a2fNg//iXyKfJAc9J5ZYZ7tGxFWSAMvmX4b/ujexDQ5BnGxIkJD9RRpj0gF4Dvug= Received: by 10.67.20.3 with SMTP id x3mr8227439ugi.3.1208422884917; Thu, 17 Apr 2008 02:01:24 -0700 (PDT) Received: by 10.66.219.9 with HTTP; Thu, 17 Apr 2008 02:01:24 -0700 (PDT) Message-ID: <9b3df6a50804170201v2a59d260u824670b86a70db7a@mail.gmail.com> Date: Thu, 17 Apr 2008 12:01:24 +0300 To: "Felipe Pena" Cc: internals@lists.php.net In-Reply-To: <1208404255.5665.34.camel@pena> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11764_29428811.1208422884914" References: <1208404255.5665.34.camel@pena> Subject: Re: [PHP-DEV] [RFC] Type hints (parameter and return value) From: arvids.godjuks@gmail.com ("Arvids Godjuks") ------=_Part_11764_29428811.1208422884914 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 > > ------=_Part_11764_29428811.1208422884914--