Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93566 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53587 invoked from network); 26 May 2016 13:53:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 13:53:30 -0000 Authentication-Results: pb1.pair.com header.from=fsb@thefsb.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=fsb@thefsb.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thefsb.org designates 108.166.43.115 as permitted sender) X-PHP-List-Original-Sender: fsb@thefsb.org X-Host-Fingerprint: 108.166.43.115 smtp115.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.115] ([108.166.43.115:34832] helo=smtp115.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/17-17600-7DFF6475 for ; Thu, 26 May 2016 09:53:30 -0400 Received: from smtp15.relay.ord1c.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp15.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 9F8BA38018F; Thu, 26 May 2016 09:53:25 -0400 (EDT) X-Auth-ID: fsb@thefsb.org Received: by smtp15.relay.ord1c.emailsrvr.com (Authenticated sender: fsb-AT-thefsb.org) with ESMTPSA id 5C7313802A4; Thu, 26 May 2016 09:53:25 -0400 (EDT) X-Sender-Id: fsb@thefsb.org Received: from yossy.local (c-66-30-62-12.hsd1.ma.comcast.net [66.30.62.12]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:587 (trex/5.5.4); Thu, 26 May 2016 09:53:25 -0400 To: Thomas Bley , ajf@ajf.me, PHP Internals References: <20160525215208.034FC1A801B3@dd1730.kasserver.com> Message-ID: Date: Thu, 26 May 2016 09:53:24 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160525215208.034FC1A801B3@dd1730.kasserver.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: fsb@thefsb.org (Tom Worster) On 5/25/16 5:52 PM, Thomas Bley wrote: > I'm not seeing a problem here: > > class A { > public int $x; > public ?int $y = null; > public int $z = 42; > public ?int $u; > public ?datetime $v; > public datetime $w; > } > > $a = new A; > var_dump($a->x); // 0 + notice > var_dump($a->y); // null > var_dump($a->z); // 42 > var_dump(isset($a->z)); // true > unset($a->z); > var_dump(isset($a->z)); // false > var_dump($a->z); // 0 + notice > var_dump($a->u); // null + notice > var_dump($a->v); // null + notice > var_dump($a->w); // Fatal error, uninitialized... > > var_dump(isset($a->x)); // false > var_dump(isset($a->y)); // false > var_dump(isset($a->u)); // false > var_dump(isset($a->v)); // false > var_dump(isset($a->w)); // false Is the file containing these examples in liberal mode? What changes if declare(strict_types=1) precedes $a = new A;? Tom