Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102824 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66647 invoked from network); 14 Jul 2018 15:59:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2018 15:59:57 -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 209.85.221.53 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.221.53 mail-wr1-f53.google.com Received: from [209.85.221.53] ([209.85.221.53:38593] helo=mail-wr1-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/ED-39793-CFD1A4B5 for ; Sat, 14 Jul 2018 11:59:57 -0400 Received: by mail-wr1-f53.google.com with SMTP id m1-v6so15088094wrg.5 for ; Sat, 14 Jul 2018 08:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:cc:from:message-id; bh=SsP2V9ht5hp8lpBTbv1cfGthtCVtsDqyI5Xmul8ioBg=; b=JNRmlvdNlzmPiJqimnPxST9VdgA1BDe8sXPfh1Q4pWJ66tHj4rTuELA4tvl2j/ap1I FEsp7G0nsoMfDP2nyqpIvAGXudf2yca3syEGGjZqQTs2YiHdO5AI/GoCzWdC0hp1eSRn V9c2x7iIyNyJ1Ae1etpUYLBIJajxjS0/egfJeaY+7omLJAcCFTB5LZKwstIXEnQ3Tg8B lJJG66+2NC7R/+QTaOlEqWMaPks2Sk5XWPp+4JlPEii3+mN+kYgUwe7d6Pu3LfdEgF1+ XYzGUfuxq9GH0GU4ZQHw1Zo1GfxUmrYKA89ilfebRcN0hqk3gNV+6piMuy7MsJMQv8OW /W9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:cc:from:message-id; bh=SsP2V9ht5hp8lpBTbv1cfGthtCVtsDqyI5Xmul8ioBg=; b=dVPby9VC7S5S1FiwHx+OhJVleYJK4A2VaHURyz+XjaglvyseeWrcnkcOvyeVFPa9aw UwpAiULZJWnDfhLO7wYuL5tY7QN8qk82vV+QObDg1HVPK3pc/e8Kn0FJaGEcxWrUC1XU w7hR8mMTFb+Sg69+xNkMF692vG3q9gT9bUoSRNBVJNnjnAtJd66z/RjgFpq34PM8BN2o 8pmtcGG4OGQ9jnq9tgealET/o0Bh4kh0IFI97vsnSa4sPtxRf4BZ19cd15UwBL9PRs1z uqH2DjAtvLJbgK3FD6A5Xn5REQjuMhTt76yPkbgMvtIket0zrFsCQzoSclxq8NI8kuHF Bcrg== X-Gm-Message-State: AOUpUlHDoTJ2yWLv/GTWwaqMOdeiAIZnfYUcHXVonhqMQinHgKZ91ts2 WGtYdmaoD5dDcv9ZBFbx8OlAcZ1l X-Google-Smtp-Source: AAOMgpdXlpV1Erpn1GFatptupSUVLJPhunS/qxDdNAMhKkb/ne5YoPfUYye13ar92YnaCf7KeCSgKw== X-Received: by 2002:adf:dfcd:: with SMTP id q13-v6mr7533094wrn.113.1531583993667; Sat, 14 Jul 2018 08:59:53 -0700 (PDT) Received: from [10.161.29.37] (92.40.249.110.threembb.co.uk. [92.40.249.110]) by smtp.gmail.com with ESMTPSA id b18-v6sm10842721wrj.72.2018.07.14.08.59.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Jul 2018 08:59:52 -0700 (PDT) Date: Sat, 14 Jul 2018 16:59:49 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: <8916EC21-D368-40F8-9ABD-CE0C04A73539@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable CC: internals Message-ID: <6E843F96-7815-4525-8AB1-D9D700B0D031@gmail.com> Subject: Re: [PHP-DEV] Non-nullable properties From: rowan.collins@gmail.com (Rowan Collins) On 14 July 2018 15:37:32 BST, Levi Morrison wrote: >> class Validity { >> public \DateTimeInterface $validFrom; >> public ?\DateTimeInterface $validTo =3D null; >> } > >Even if this had a constructor we couldn't "trust" it because there >are ways to skip constructors=2E Then the mechanisms should either be impossible with non-nullable properti= es, or have a way to mark the object initialised=2E If not, the object crea= ted would not be fully initialised, so accessing *the entire object* should= be an error, not just accessing the specific properties which are marked n= on-nullable=2E I'm not claiming any of this is easy, but if you can't guarantee a propert= y has a valid value, what is the type hint actually for? Regards, --=20 Rowan Collins [IMSoP]