Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67137 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99236 invoked from network); 24 Apr 2013 19:22:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2013 19:22:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=hello@apfelbox.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=hello@apfelbox.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain apfelbox.net from 83.169.28.40 cause and error) X-PHP-List-Original-Sender: hello@apfelbox.net X-Host-Fingerprint: 83.169.28.40 vwp5063.webpack.hosteurope.de Received: from [83.169.28.40] ([83.169.28.40:56673] helo=vwp5063.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/C7-60231-FE038715 for ; Wed, 24 Apr 2013 15:22:24 -0400 Received: from stgt-4d024760.pool.mediaways.net ([77.2.71.96] helo=[192.168.1.98]); authenticated by vwp5063.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1UV5Gm-000803-MU; Wed, 24 Apr 2013 21:22:20 +0200 Date: Wed, 24 Apr 2013 21:22:23 +0200 To: Stas Malyshev Cc: Raymond Irving , PHP Internals Message-ID: <65C99E7211FB43D88E67D212622F7CBA@apfelbox.net> In-Reply-To: <5178142D.1070204@sugarcrm.com> References: <5178142D.1070204@sugarcrm.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="517830ef_6b68079a_963f" X-bounce-key: webpack.hosteurope.de;hello@apfelbox.net;1366831344;061fbfd4; Subject: Re: [PHP-DEV] Object Type Casting From: hello@apfelbox.net (Jannik Zschiesche) --517830ef_6b68079a_963f Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, =20 I guess it would work like an inline type-hint. Something along the lines of: =24circle =3D Shape=46actory::createShape('circle'); if (=21=24circle instanceof Circle) =7B throw =E2=80=A6; =7D I would like something like this, since it saves quite some code. Cheers Jannik Am Mittwoch, 24. April 2013 um 19:19 schrieb Stas Malyshev: > Hi=21 > =20 > > Are there any plans to add object type casting support in PHP=3F > > =20 > > =46or example: > > =24circle =3D (Circle) Shape=46actory::createShape('circle'); > > =24circle->radius =3D 10; > > echo =24circle->getArea(); > > =20 > =20 > =20 > What is this supposed to do=3F I.e. what createShape returns and what > (Circle) operator is doing to it=3F > =20 > > It would be great if this feature could be added to 5.5 :) > =20 > 5.5 is in feature freeze, so it won't happen in any case. > =20 > -- =20 > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > =20 > -- =20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > =20 > =20 --517830ef_6b68079a_963f--