Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93573 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71872 invoked from network); 26 May 2016 16:47:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 16:47:48 -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.50 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.50 mail-wm0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:36102] helo=mail-wm0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/2A-17600-4B827475 for ; Thu, 26 May 2016 12:47:48 -0400 Received: by mail-wm0-f50.google.com with SMTP id n129so236080876wmn.1 for ; Thu, 26 May 2016 09:47:48 -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=JX3FcC4cCLgJe2hCDLlbC4dOKT5wlSeIjHyh9uM9/Ws=; b=0CsVylYzhV5SN09w0Hh9AYgzx62Ytb53Ou0U4gqeJcYQ3y6NEzurBH45yj+RXix2XV ec/Mo+yfLoJ8a5sUXT6p29Bzt7+W88pOXZ1EXks9YHQzcAE5i4aj1CtCLAhncuV+F5CK GePXgc4AOjSKZ+6plpnLxCA+MVwLx/kOagYd3O4m9ZZlQ9MJEU5rH4S9jyTA07Zg0J2l efVOmuC2Bk1+syOhDunWMV8RP//yoAtnw3dS18wN4FctOwC5aM2cyRmbHloYenbOujyr S6bDgQyifXWdNG3tCSktXnUEuaMtXRH4ZOdl5DHBevh1aQ+SjiDuroEvn/fiyY0ACS/Z FQzw== 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=JX3FcC4cCLgJe2hCDLlbC4dOKT5wlSeIjHyh9uM9/Ws=; b=EtQV2mQYQYQ88VqdcizT8Krg+tBEdRVeSVfO7PkkrPhNX5P41fa4ZGd4gJR0iONsSr cakdM9EDL4tO9Rh/VAa+yNiSGWXsaYshyBYUzXBQA229+lAiuPIneA647LXHN3ToT8sc g9p2o38PC5Xziw8aquptFMiXaB4xww2MexD0ediaZX8VAsMvCJwVw5QF0xuP2zRxmPlY yJQeoEzuoFa3uvjiVkhqjvKhYOf+Noky3j4RhYhgsXjVt66kvDSlTwj0tyM2SjkA9A4z 2pysKQwkW4awAh9TA7hIZSwtzWrwDe1IPOQHDev0EWHDDNSzZr4uyHfC8ZOsjUdjuHbA DPIA== X-Gm-Message-State: ALyK8tIdG9+r4ZkKdKXyLyfFPYNUN92jh3VM1sZRvddr7XtoISFM1KRsWSo9C1qBFZipaw== X-Received: by 10.28.213.1 with SMTP id m1mr4753761wmg.103.1464281265323; Thu, 26 May 2016 09:47:45 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id t13sm4371189wmt.14.2016.05.26.09.47.44 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2016 09:47:44 -0700 (PDT) To: internals@lists.php.net References: <20160525215208.034FC1A801B3@dd1730.kasserver.com> <5fd54aa0-4fdf-c1e7-eae8-765aa89c8498@fleshgrinder.com> Message-ID: <82f22b71-349e-f47a-b2e9-3768bf202941@gmail.com> Date: Thu, 26 May 2016 17:46:00 +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: 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 17:40, Tom Worster wrote: >> 0. Fatal error after __construct was called. >> >1. Fatal error and abort. >> >2. Initialize with appropriate type. >> >3. Initialize with null. > Under another 5th option, the problem you state does not arise. Disallow > "public int $x;". Under this option you may declare $x with type int and > an initial value or you may declare $x without type but you may not > declare $x with type (nullable or not) and undefined initial value. That has the same problem as 2 - not all types can be initialised statically, so can't be declared this way: class Foo { HTTPRequest $request = SOMETHING; } How do I safely initialise that? Regards, -- Rowan Collins [IMSoP]