Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66966 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48102 invoked from network); 5 Apr 2013 08:01:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2013 08:01:53 -0000 Authentication-Results: pb1.pair.com header.from=Richard.Bradley@softwire.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=richard.bradley@softwire.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain softwire.com from 91.220.42.220 cause and error) X-PHP-List-Original-Sender: richard.bradley@softwire.com X-Host-Fingerprint: 91.220.42.220 eu-smtp-2.mimecast.com Linux 2.6 Received: from [91.220.42.220] ([91.220.42.220:59802] helo=eu-smtp-1.mimecast.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/10-46889-DE48E515 for ; Fri, 05 Apr 2013 03:01:50 -0500 Received: from smtp.softwire.com (217.20.22.70 [217.20.22.70]) (Using TLS) by uk-mta-5.uk.mimecast.lan; Fri, 05 Apr 2013 09:01:46 +0100 Received: from VEXCHANGE10.zoo.lan ([169.254.1.114]) by VEXCHANGE10.zoo.lan ([169.254.1.114]) with mapi id 14.02.0342.003; Fri, 5 Apr 2013 09:01:45 +0100 To: Rasmus Schultz , Benjamin Eberlei , PHP internals Thread-Topic: [PHP-DEV] a couple of thoughts on the DateTime type debate Thread-Index: AQHOMYgPp7zb/cY3OEiTz4NCWsvyY5jHQ2Vg Date: Fri, 5 Apr 2013 08:01:45 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.210.10.1] x-pp-processed: __PP2__318564c6-eb00-4118-ba4c-be920aac5003 MIME-Version: 1.0 X-MC-Unique: 074dc715-8693-4b84-8458-23e7239bb74a-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: RE: [PHP-DEV] a couple of thoughts on the DateTime type debate From: Richard.Bradley@softwire.com (Richard Bradley) > On Thu, Apr 4, 2013 at 12:57 PM, Benjamin Eberlei wr= ote: > > > > > 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 accu= rate. Actually "structs" in C# can have methods. They are exactly classes with va= lue 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 familia= r with that. See the "Structs Tutorial" at msdn for a brief summary of structs in C# - h= ttp://msdn.microsoft.com/en-us/library/aa288471(v=3Dvs.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