Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67133 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85696 invoked from network); 24 Apr 2013 16:45:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2013 16:45:51 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.45 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.128.45 mail-qe0-f45.google.com Received: from [209.85.128.45] ([209.85.128.45:56994] helo=mail-qe0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/35-60231-A3C08715 for ; Wed, 24 Apr 2013 12:45:48 -0400 Received: by mail-qe0-f45.google.com with SMTP id 1so1369256qee.18 for ; Wed, 24 Apr 2013 09:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Hg5ruKrqpbbUWMg23g0cMHeHjo+iwLtrVR1425OB04w=; b=RqdWE3LlngRM0MJRLS7aUwCyfBVSK23yataCFrRZm1XLgTxYLvVJGOlu4/N5U1qouA A71tvAXZc3zGFruj8bixBuEiO5W+rGNcVZ8E8UBgQyIEfMfjWprpdqqYARF0AxPvZjXn L5fAEM51454GCU72jKGv8SSVpL7L9niVgmvVCrREFjxtuVgIHkgsSnIPCQZqj4ZdFbw2 uUohMXKmeSKe0It1uFav8f1+mz9Lg66rTMpGZCWDIDTReqwdteLGDW4uDP2KGi//XwnP LbOfGPaPXXkJXabST2GBKM1cISz+lAswSa/LBNV7Z9V0oPtDzVcKhy9RxhPSXd7yHtnj lA7w== X-Received: by 10.224.56.10 with SMTP id w10mr2868713qag.41.1366821944718; Wed, 24 Apr 2013 09:45:44 -0700 (PDT) MIME-Version: 1.0 Sender: ekneuss@gmail.com Received: by 10.49.87.70 with HTTP; Wed, 24 Apr 2013 09:45:24 -0700 (PDT) In-Reply-To: References: Date: Wed, 24 Apr 2013 18:45:24 +0200 X-Google-Sender-Auth: Qsr3ksnw4dvawtnxJVPNvkLCqdc Message-ID: To: Raymond Irving Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c2ffcc7c7d1304db1e08d7 Subject: Re: [PHP-DEV] Object Type Casting From: colder@php.net (Etienne Kneuss) --001a11c2ffcc7c7d1304db1e08d7 Content-Type: text/plain; charset=UTF-8 There are no concrete plans no. Object casting is typically available to please the static type checker. This concern does not exist in PHP since types are checked at runtime. So my first question would be: Why do you need it ? Other questions include: what would it do for up-casting, down-casting, and also casting to incompatible objects? How will it handle private properties? Best, On Wed, Apr 24, 2013 at 6:40 PM, Raymond Irving wrote: > Hello, > > Are there any plans to add object type casting support in PHP? > > For example: > $circle = (Circle) ShapeFactory::createShape('circle'); > $circle->radius = 10; > echo $circle->getArea(); > > It would be great if this feature could be added to 5.5 :) > > __ > Raymond Irving > -- Etienne Kneuss http://www.colder.ch --001a11c2ffcc7c7d1304db1e08d7--