Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114921 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30575 invoked from network); 17 Jun 2021 09:14:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2021 09:14:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CC46F1804D1 for ; Thu, 17 Jun 2021 02:31:50 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 17 Jun 2021 02:31:50 -0700 (PDT) Received: by mail-qt1-f179.google.com with SMTP id v6so4153958qta.9 for ; Thu, 17 Jun 2021 02:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=blbOmG9UhUUZiJOPw7COx6bIMN8MZsWkX1MVPyBHEZY=; b=Pz6ax8C8c4tptjZGHdQZjR6GiwxAfa/7foubQlZqo2d/4EN6Chsv1El0tDzMkIzBzn IQUuTOJ3ASHjBWY1n9w4FBgcah+2jsVpS21HAesPl46X5r42ZOsbVjblNLncuBM3Y1j9 FC2fM+UTDw6mT3eyrHN6eBu4cjDPmwlpRQHupBzmUTYWXEWRcoTSleWFyUhQK2yr27Np /vlzlEGeBJp2JZChlUua2Rb6hn/DZHIHNSGRlff9lVgU4IwH9tdvAockLg550XBWR2+O SCaFlUYq1TnBzD1FQZ+2k5rz/+CttMk6UJJg+5lFLR51Tu9aOL+za7wZAVacyayIrmfG Zv9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=blbOmG9UhUUZiJOPw7COx6bIMN8MZsWkX1MVPyBHEZY=; b=bbYUsalyJ04INDLAAKFVLbmlFk9gs3F1YkmcOXfdqrEl3VJTLhCtuPekAaISDBbcit v/1FFOc4Y6KOQJtt5HjQZjeHe0xpsa6vawt3T+GfJIMbJ8kqMHAvBujNY6Okbe+CxbKC VUnUQL90wwD0/Ffd9ZAWewLQQsEjGwTX9cLaKREZ0TwSfUx/NFEpnaaTz32fv0xvRSD8 h/JMUaFKaahZ9LlPrk8czv/De9v1KNvLYxyEClPQ9mEGp4i8cGymPEiG5Prrqafws3Wo BTy6Ai3B+J9SgnAFU2mFFXa3StxjQda0H6IxrlRb/5XFp7h7/6++MkchUQtIoW8h7c3B e3Pw== X-Gm-Message-State: AOAM532wHmkfBIze9WP8cfo3TwIcT+jy01H+wV+wtHeJbWmSglCtRiMZ dEzDMFPz98/WB7nqzgqutmfGwg== X-Google-Smtp-Source: ABdhPJyaGuQCsQDpID6+2quJZ0/v8rNJqDlRrcyoDzk63R2gMOZ6L5FUFq9CnglmCKZnnbcncZ7/MA== X-Received: by 2002:a05:622a:1212:: with SMTP id y18mr4114085qtx.321.1623922307227; Thu, 17 Jun 2021 02:31:47 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id i26sm857829qka.86.2021.06.17.02.31.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jun 2021 02:31:46 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) In-Reply-To: Date: Thu, 17 Jun 2021 05:31:46 -0400 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <88588b8f-5729-4458-90b1-c602f751e128@www.fastmail.com> <33fd3541-8518-4f98-a258-705f85180ed1@www.fastmail.com> <85f85e0e-a926-4b57-8509-72e9c852c78b@www.fastmail.com> To: Nicolas Grekas X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] [RFC] New in initializers From: mike@newclarity.net (Mike Schinkel) > On Jun 17, 2021, at 5:14 AM, Nicolas Grekas = wrote: >=20 > Le mer. 16 juin 2021 =C3=A0 13:47, Larry Garfield = a > =C3=A9crit : >> Would others be comfortable with that, if it allowed new-initializers = for >> static properties and class constants? >>=20 >=20 > Honestly, I don't know. >=20 > Instantiation might fail because of either a throwing constructor or > because of a throwing autoloader. >=20 > Being able to know where to put the try/catch to recover from these = might > be important when writing generic code. >=20 > With the current state of the RFC, it's fine. With "undefined = evaluation > time", it might make things fragile without any way to make them = resilient > enough. Wouldn't the simple way to make them resilient enough be to wrap a = try-catch block around any code that potentially throws an exception = within the class being instantiated on initialization? -Mike=