Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58095 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69114 invoked from network); 26 Feb 2012 21:40:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2012 21:40:54 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:55658] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/74-40985-6E6AA4F4 for ; Sun, 26 Feb 2012 16:40:54 -0500 Received: by wgbdq12 with SMTP id dq12so3292269wgb.11 for ; Sun, 26 Feb 2012 13:40:51 -0800 (PST) Received-SPF: pass (google.com: domain of keisial@gmail.com designates 10.180.92.71 as permitted sender) client-ip=10.180.92.71; Authentication-Results: mr.google.com; spf=pass (google.com: domain of keisial@gmail.com designates 10.180.92.71 as permitted sender) smtp.mail=keisial@gmail.com; dkim=pass header.i=keisial@gmail.com Received: from mr.google.com ([10.180.92.71]) by 10.180.92.71 with SMTP id ck7mr27441967wib.3.1330292451695 (num_hops = 1); Sun, 26 Feb 2012 13:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=CV7kR3CJqosY2Eaupq5mV6FqsZjFuyaD/FJbZngITTk=; b=l0q2XEozi0WjhATFIy8VlBw6d0RNoyN8idc+EHbP7lo012fU5EouGAoxtfWrn6Ep+8 n2ctaZaEf1eoZMJC9ZUPmYfWW5NMdnD9HYzOraorUrcl4JSNg6BsIqpy+78C3LspcicW 0hTZ5P7i+lOHwYCPELme0sTYC3x56dLi4++aQ= Received: by 10.180.92.71 with SMTP id ck7mr22076126wib.3.1330292451614; Sun, 26 Feb 2012 13:40:51 -0800 (PST) Received: from [192.168.1.26] (33.Red-83-44-158.dynamicIP.rima-tde.net. [83.44.158.33]) by mx.google.com with ESMTPS id h19sm17764061wiw.9.2012.02.26.13.40.49 (version=SSLv3 cipher=OTHER); Sun, 26 Feb 2012 13:40:50 -0800 (PST) Message-ID: <4F4AA807.20404@gmail.com> Date: Sun, 26 Feb 2012 22:45:43 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Anthony Ferrara CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Object Casting - An Alternative to Type Hinting From: keisial@gmail.com (=?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?=) I just realised that if it were going to add magic casting, it could as well be done with a spl_autocast_register(), so that you could either cast things when they match, throw an exception, etc. (there should be some default value dynamic typing, so the perfomance wouldn't hurt) . I don't think that's the perfect solution, though.