Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37049 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61497 invoked from network); 17 Apr 2008 03:51:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 03:51:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.166.183 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 64.233.166.183 py-out-1112.google.com Received: from [64.233.166.183] ([64.233.166.183:57819] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/FB-03488-A29C6084 for ; Wed, 16 Apr 2008 23:51:06 -0400 Received: by py-out-1112.google.com with SMTP id u77so2519607pyb.16 for ; Wed, 16 Apr 2008 20:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=dgM6HdT9pkvjD7C1EYKMgY7U/JWJZHx/BqEkPt4WRNc=; b=V2iqUPdFh7WT+9A+73684y1HCivTJduVgaMiR9qB490fVax+mwBVwCvO202NOxc2bxAlLw4qfN4XLubZx1qDlJRFoe+BroRpxqI4CE+yGXZZ834dOdULcnXfLZcHDdn/a+12iFEddMyh4bpihe2D7cslcnIokrl0AZAu2gP9GKY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=pxhM1qZwBBxPMqq669vhswygUQKxl6I9Qkribe/mjm4C43+9X1BB4CMdhyvdq4Is58iLDH/cf3rTgb231Nrg00FVDJ2gZnbqnTi7QIMr9sOstKyr3UxS+8cAJmgopv8Ylm6CRcFanrscpkhxrbdhcxCRnN92Nw+zoDRmpgY+eBI= Received: by 10.64.114.11 with SMTP id m11mr1446732qbc.50.1208404264016; Wed, 16 Apr 2008 20:51:04 -0700 (PDT) Received: from ?192.168.1.2? ( [189.24.182.224]) by mx.google.com with ESMTPS id f17sm8030875qba.35.2008.04.16.20.51.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 16 Apr 2008 20:51:02 -0700 (PDT) To: internals@lists.php.net Content-Type: text/plain Date: Thu, 17 Apr 2008 00:50:55 -0300 Message-ID: <1208404255.5665.34.camel@pena> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Subject: [RFC] Type hints (parameter and return value) From: felipensp@gmail.com (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.