Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105204 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 64944 invoked from network); 10 Apr 2019 15:23:20 -0000 Received: from unknown (HELO mail-io1-f52.google.com) (209.85.166.52) by pb1.pair.com with SMTP; 10 Apr 2019 15:23:20 -0000 Received: by mail-io1-f52.google.com with SMTP id b6so1933775iog.0 for ; Wed, 10 Apr 2019 05:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ZRoRF6RsD7DCTP5oSklv7s40UtDEC5/lnCOSUD1U08U=; b=lyN5CCQqy7PacGQQ7LhikbTY/7ao5wul36Njq0ftOIHREZ1bqs71ypQn/VDkFqyMza zNo9dQCOGrZw9I1SybMTj5On6Njb0CBOavuPldiY6YmaOFZh8QdCyifYJBScj85NQwnQ DVxNkj+vWq54pZkWCuKGj2Hi6B/5bIB16ORl1r6dpQ7cUPoQy5LhXd1UsNVlWBRibiDT B4JGCZ49bpNIsO6LCqgDJdCXN10M3lFu3kHc5w5l/USlvN6d+Otk4gQ9GvzrXOmmEGtL pueGIM6M8xMAdjGtu7L7vi9WLlH7wmQNzL2QG8jrx6FIRG69LDqHiLEzWRJWpJ65KwVd KLJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ZRoRF6RsD7DCTP5oSklv7s40UtDEC5/lnCOSUD1U08U=; b=NbYDtEWIM1xYrwK4lRjBy48w/rWtyKpaMeQudYrpS4XTNmxR27e86mRAoypFEJuOwU UKGJTlh1JuveDZ2d3YPjtYJPM+GIw8C6RblL1/5Ll6O5CTlIPvpSB27QzeWnKq3be3Yw SCQPC0D8otJd9OuY1wn8yEcRXmw2/tPsGsrmTh7ODvREu1OdUmJw1r9pwCDWRYnszGA1 6alpTQPl2TrQS1qfGRIqHz15U4xJ7sR6aAMoDxs4zdebaoGkuEXsVDMfn3cMca0jvRlb ajw83wFr9G6MF0bUnUDcDxSIYyzFqBhIFtkg66BksAZSE3SJXC/sAWgie0ArIWIngWOG dT5A== X-Gm-Message-State: APjAAAUqUj54u8igaiKWAg95+UVC27BLWSHr9w/lbbGuF7GHedzXtalF MgduygDGRoU5pNQy1AQlAPym8ZPlLGLI972vEDR3g20E X-Google-Smtp-Source: APXvYqypBoEY+5c95xRAzEFTeDWU0DJ3JkUl7jONgNF8WggoKjRYiqSqY0TkVgINoHwotVgDDzW4Jo7O+ozkhZaAMj8= X-Received: by 2002:a6b:e706:: with SMTP id b6mr28152353ioh.78.1554898827692; Wed, 10 Apr 2019 05:20:27 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 10 Apr 2019 14:20:16 +0200 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="000000000000494d8a05862c18ae" Subject: Unset static properties From: benjamin.morel@gmail.com (Benjamin Morel) --000000000000494d8a05862c18ae Content-Type: text/plain; charset="UTF-8" Hi internals, I came across this when playing with static properties: class A { public static int $x; } // This throws, as expected: // Error: Typed static property A::$x must not be accessed before initialization echo A::$x; // Once we initialize the property: A::$x = 1; echo A::$x; // 1 // There is no way to revert the property back to uninitialized state: // Error: Attempt to unset static property A::$x unset(A::$x); Is this expected behaviour? I don't currently have a use case for this, but am wondering whether it is consistent to disallow un-initializing a static property when it's allowed to be uninitialized in the first place. Cheers, Ben --000000000000494d8a05862c18ae--