Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119737 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2975 invoked from network); 17 Mar 2023 11:32:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Mar 2023 11:32:39 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9BC9718037E for ; Fri, 17 Mar 2023 04:32:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 17 Mar 2023 04:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1679052756; bh=Pcbj9QlEnygHz8uPGQeJ6ZwNzN5tr4v+YHHqxg0bvjs=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=BZY0OlU1R8tBqG5MtVeSzPWaYzShCh+/TY2NjfGUeoZGbQ1bzoy1UKKFVg4H9e7p8 Opa+iljvUXRS3pWklA5pdgM8N4zL8wh9w2lQHU1hAw0BH+hjG0xQ6fHo2sESCnYj// PCFmjeWtIPo2W7QIasrhmHGABXL6sRi6XtT6kE9UtrJqZLKFcGj3i7n2hOc+0KtWdf V+UrQidzZLO9m0KOj8I8ABtLGC1i7TvUE3951ox9vtKiOmtcRcurBFEos+cHTn5D4D 7i9e9vThLwHK0QMvVWl9WN0qHBT30CTZGzVrGpxj9SAR4OlkJCwp29nIzTZ/FijlEk MiKDh6BCFCl9w== Message-ID: <55a0f953-b69d-5762-18f4-2af3159b30dd@bastelstu.be> Date: Fri, 17 Mar 2023 12:32:33 +0100 MIME-Version: 1.0 To: internals@lists.php.net References: <57ed96c2-0547-c905-1c6f-7433ecb4a1b5@bastelstu.be> <684c1457-16e1-1cf2-b005-b273ff7e4929@bastelstu.be> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC][Vote announcement] Arbitrary static variable initializers From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi Thank you, I've had another read through the RFC. On 3/16/23 12:51, Ilija Tovilo wrote: > Let me know if anything is still unclear. > Isn't the destructor+exception example misleading? In that case the initial value of '$x' is constant, thus it should always be known to reflection, no? Should the example look like this: > function foo($y) { > $x = new Foo(); > static $x = $y; > } > > try { > foo(42); > } catch (Exception) {} ? Side-Note: I find the behavior of static variables that do not overwrite existing variables extremely confusing, even without this RFC: https://3v4l.org/ApIcA. Anyone who doesn't define them at the very top of a function deserves a special place in hell :-) Best regards Tim Düsterhus