Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44676 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39582 invoked from network); 3 Jul 2009 09:52:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2009 09:52:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.220.224 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 209.85.220.224 mail-fx0-f224.google.com Received: from [209.85.220.224] ([209.85.220.224:58923] helo=mail-fx0-f224.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/49-27980-6D4DD4A4 for ; Fri, 03 Jul 2009 05:52:23 -0400 Received: by fxm24 with SMTP id 24so2237318fxm.23 for ; Fri, 03 Jul 2009 02:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=PGNvXk5JNLqDrlHwQ/CpZzTmlC4N4DzDd1E+nTIREWM=; b=ZTXJVtR7U0gg9OGTD85spj1uUDStPPSVkU1ftCOGuDwKbREELconv0GMaIC6snq0Ks 4HGhE2xF7VTDWsNoXjuSuKYwZKrtc9Z0uIlYG1yMEXztX/2Y+3pBjqGjC4pVSgqMo1wW ZfGQgXV+aIrY5R3p6D65w0/fIMSpXx1wvqNNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=iOSmnQQs/Pl2j3Hsj5eALwQUGyjvaMf1IGOhYImef6PKjI3z7VUyvCWynKF8VUArC4 KFYXyZJ1Y1Q7em1Sud4ESxX84hq94O9CruSKoKDKTX47lAXNn0z/xqjyO/Cq27LkEjVa 8MZcIsQKCzMNyQVX/CcMu+ibW+ndBFq5QA8I0= MIME-Version: 1.0 Received: by 10.223.103.194 with SMTP id l2mr743699fao.55.1246614739815; Fri, 03 Jul 2009 02:52:19 -0700 (PDT) Reply-To: RQuadling@googlemail.com In-Reply-To: <4A4CF889.9090405@zend.com> References: <85073B28-671D-4A8F-B2D6-5704E3E180BB@ilia.ws> <89868409-EBAC-47DE-8D6D-0DCD88DE9DE6@ilia.ws> <67163A6A-9C8F-4F59-82A4-0B46A2EBEAE9@pooteeweet.org> <93ED589E60BA254F97435FE6C97F2C6702B925DD@leedsmet-exch1.leedsmet.ac.uk> <4A4CF889.9090405@zend.com> Date: Fri, 3 Jul 2009 10:51:59 +0100 Message-ID: <10845a340907030251nca2a133g34e160ed4c674d5a@mail.gmail.com> To: Stanislav Malyshev Cc: "Ford, Mike" , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: Flexible type hinting From: rquadling@googlemail.com (Richard Quadling) 2009/7/2 Stanislav Malyshev : > Hi! > >> =C2=A0 =C2=A0function func(int $i) >> >> for strict type checking, and >> >> =C2=A0 =C2=A0function func((int)$i) > > Without saying anything on the merits of having both syntaxes, visually I > think this looks much nicer, even with the disadvantage of parentheses > overload. Oh look, auto-casting. And __cast() is excellent, but would be at odds with __toString(). And then having __toBoolean(), __toInteger(), etc. might be a bit OTT. How about __cast($type [,$class]) where $type is one of the T_xxx_CAST constants and class is the required class for a class casting? (See nearly already there!) T_ARRAY_CAST T_BOOL_CAST T_DOUBLE_CAST T_INT_CAST T_OBJECT_CAST T_STRING_CAST --=20 ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474= 731 "Standing on the shoulders of some very clever giants!" I need a car : http://snipurl.com/l4pih ZOPA : http://uk.zopa.com/member/RQuadling