Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66967 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50684 invoked from network); 5 Apr 2013 08:31:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2013 08:31:10 -0000 Authentication-Results: pb1.pair.com header.from=dor.tchizik@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dor.tchizik@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.54 as permitted sender) X-PHP-List-Original-Sender: dor.tchizik@gmail.com X-Host-Fingerprint: 209.85.219.54 mail-oa0-f54.google.com Received: from [209.85.219.54] ([209.85.219.54:48714] helo=mail-oa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/70-46889-CCB8E515 for ; Fri, 05 Apr 2013 03:31:09 -0500 Received: by mail-oa0-f54.google.com with SMTP id n12so3776065oag.13 for ; Fri, 05 Apr 2013 01:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=HNnV80RA5zTGoT1G+WAd/ApV9EDQN/CHRK8KceJC5ys=; b=f2qgQGSkGy11Y2Fy/gaMTq4bqkTqD3VJ0nG3pOD9Fmv3erqBToJoAxXwAUKzs4EuW/ UimEsLsVwOglegqiuFxbjUjcEDub5ffmqAwvZ8MylkcMd8rZP9sBN69+24SsAvFoPN44 zNuiKxgVpow18amISn0cOtSPjh2FisXtuQan8T/c31z2SyFU9gy0I3pgcZlPGytB2ofq +3pfYRYJ+8ri0qAH5c35T528V8Kampz8B6eOqdTTfeeN9NUvn7r9pZqhprEghGGZVi5l X0rfxNdjZiu27bDQeXA8R7QNLMhNrPsCtIW5x4LGDugkyCSvmcPafPMRY1in/hUiq0bQ 2XQA== MIME-Version: 1.0 X-Received: by 10.60.50.102 with SMTP id b6mr7264595oeo.46.1365150666530; Fri, 05 Apr 2013 01:31:06 -0700 (PDT) Received: by 10.182.128.69 with HTTP; Fri, 5 Apr 2013 01:31:06 -0700 (PDT) In-Reply-To: References: Date: Fri, 5 Apr 2013 11:31:06 +0300 Message-ID: To: Richard Bradley Cc: Rasmus Schultz , Benjamin Eberlei , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] a couple of thoughts on the DateTime type debate From: dor.tchizik@gmail.com (Madara Uchiha) After discussing things over the PHP chat on Stack Overflow, I realized I misread and missed the point. Good suggestion, you have my +1. On Fri, Apr 5, 2013 at 11:01 AM, Richard Bradley wrote: >> On Thu, Apr 4, 2013 at 12:57 PM, Benjamin Eberlei wrote: >> >> > >> > structs as in c# don't have methods, however DateTime has them. so >> > this doesn't work. What you can do is just pass all the data in the >> > constructor and then don't change it, and you have your value type that is immutable. >> > It just requires a bit self control. >> >> On 04 April 2013 23:59, Rasmus Schultz wrote: >> >> You're right, struct isn't the right word - "value" is probably more accurate. > > Actually "structs" in C# can have methods. They are exactly classes with value type semantics (i.e. pass-by-value, like arrays in PHP). > > I think "struct" would be an ideal name for this feature, as this proposal matches the C# implementation very closely, and many people will be familiar with that. > > See the "Structs Tutorial" at msdn for a brief summary of structs in C# - http://msdn.microsoft.com/en-us/library/aa288471(v=vs.71).aspx > > > > Richard Bradley > Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575 > > softwire > Sunday Times Best Small Companies 2012 - 6th in the UK > Web : www.softwire.com | Addr : 325 Highgate Studios, 53-79 Highgate Road, London NW5 1TL > Softwire Technology Limited. Registered in England no. 3824658. Registered Office : 13 Station Road, London N3 2SB > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >