Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93596 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49639 invoked from network); 27 May 2016 08:29:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 May 2016 08:29:16 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.45 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wm0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:36384] helo=mail-wm0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/E0-37127-C5508475 for ; Fri, 27 May 2016 04:29:16 -0400 Received: by mail-wm0-f45.google.com with SMTP id n129so261225643wmn.1 for ; Fri, 27 May 2016 01:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=6Wl0gCa+MH3HC0GsplMKJYTd2+RtOd/WZI9E8/AoE2Y=; b=xOWTKn07qMdPGQ9EEd2RSdMKSx1pCUPdt8fxbnnTvMquqd01snEgdvRzWwqXOK38M1 c6c4Tz5cpdqm/FmtEQrTyi+vjxFl09WfMbxaHbO5Z/j14bLXumefOo0rl5HKWl6bmltV w85t2EJxe+mHVQWpeJYmUOhpxi5fhbtRReglHoAR1nBYPDDX7hlnWFBsDgPvV+p5G/Kb LJZS3U9iewHNd0cAsOgoa7DAiRS9MD0Xr3TxeUzpl6BwBKrPkCaBajMA/2OHLriKFqUp cTSskxOpzvwyLKd76G28xsspwJrIuVFiRPXPHgDon4ba54AhePBtyUoin5f8l0SSA3KH 6mrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6Wl0gCa+MH3HC0GsplMKJYTd2+RtOd/WZI9E8/AoE2Y=; b=QHYBLPbb3j8lF2bMQH4spTL3Q/8t9SHa6WTmaiMeXocpLA3CE5RDbOczKQM+bUs1j1 Qt1BCg8WNRDt0pD4tu+TtJnDZN5kD3Zv6WVd4O1wB7nqsq0xvvhntrlVwUNmDM4aqEik 9Nk2OpmI9A9amXw4tVSogdq6nTZ57+dl0s2hVUA8BthxzxW/bvNCVD9cEZ6nEQO9pIfT qmbFYvBzeNqXk/D1DdiKfwPrfKd1vikU6eOaQwQXoMmkktzDqFHFedVCkTq00jxeXtn9 /oMGoZpTqOlzE4EGx0EUi+6ukv0nlQmZnS+qzhpfyVMLFX59QuI8YvdNZmoVCwBPSTpx B6NA== X-Gm-Message-State: ALyK8tKF2jQ88GGMVt7oCmJe+z20TearzCitn0V/BUimDkaSmCV+XWfG/dYZhqByZICetQ== X-Received: by 10.28.58.6 with SMTP id h6mr5458764wma.101.1464337752722; Fri, 27 May 2016 01:29:12 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id ib1sm18186165wjb.48.2016.05.27.01.29.10 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 01:29:11 -0700 (PDT) To: internals@lists.php.net References: <20160525215208.034FC1A801B3@dd1730.kasserver.com> <5fd54aa0-4fdf-c1e7-eae8-765aa89c8498@fleshgrinder.com> <08963b03-8394-6d62-4e5b-393f3fcb5647@fleshgrinder.com> <9e9db70d-d72d-d93e-0c81-18c2aa228618@gmail.com> <409002d8-b5e3-5990-7358-246adc7e3cab@fleshgrinder.com> <57474A08.80807@lsces.co.uk> <6f7403b6-bf22-a12b-dfb2-43fe82983e7d@fleshgrinder.com> <57474F9C.6080104@lsces.co.uk> <1733cfce-001b-1079-e929-88f7dde0f2dd@gmail.com> <57475F27.3090306@lsces.co.uk> <34edcbd1-2d6a-cd52-7bbb-c393ab62d32d@gmail.com> <574772BA.3030305@lsces.co.uk> Message-ID: Date: Fri, 27 May 2016 09:27:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <574772BA.3030305@lsces.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: rowan.collins@gmail.com (Rowan Collins) On 26/05/2016 23:03, Lester Caine wrote: > On 26/05/16 22:38, Rowan Collins wrote: >>>> // accessing $me->marriage or $me->death returns NULL (because they >>>>> allow nulls) but raises E_NOTICE >>> BUT DateTime currently will not store 'null' - it returns 'now' instead. >>> We end up having to store string or integer values because we can't >>> store a null date :( >> >> That's exactly what ?DateTime is for - "either DateTime or Null", just >> like in a database. >> >> In most type systems, there is no such thing as "a null date" - if it's >> null, it's not a date, it's a null value. > > The exact question here then is in relation to just how one uses > 'DateTime' in this situation? Or more accurately how one maintains the > 'or Null' state when the type does not allow null itself? I don't understand the question. class Foo { ?DateTime $d } $f = new Foo; $f->d = null; $f->d = new DateTime; It's either a DateTime, or it's null. Regards, -- Rowan Collins [IMSoP]