Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66968 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53071 invoked from network); 5 Apr 2013 08:58:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2013 08:58:52 -0000 X-Host-Fingerprint: 86.14.252.140 cpc3-asfd3-2-0-cust139.1-2.cable.virginmedia.com Received: from [86.14.252.140] ([86.14.252.140:11274] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/E0-46889-A429E515 for ; Fri, 05 Apr 2013 03:58:50 -0500 To: internals@lists.php.net,Madara Uchiha Message-ID: <515E9246.2010505@php.net> Date: Fri, 05 Apr 2013 09:58:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 86.14.252.140 Subject: Re: [PHP-DEV] a couple of thoughts on the DateTime type debate From: krakjoe@php.net (Joe Watkins) On 04/05/2013 09:31 AM, Madara Uchiha wrote: > 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 >> You are shooting at ants with bazookas ... I don't see a clear path from an immutable DateTime to C# structs in PHP ... This seems like a crazy conversation to me, not only is it crazy, it's a waste of time; I don't see any of the people able to implement it actually implementing it, and I don't see a vote going in favour of the idea if there were an implementation. /me attempts to push the conversation back on track ...