Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107964 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 54359 invoked from network); 3 Jan 2020 01:36:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jan 2020 01:36:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5C87B1804DC for ; Thu, 2 Jan 2020 15:40:51 -0800 (PST) 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.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (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, 2 Jan 2020 15:40:50 -0800 (PST) Received: by mail-yb1-f169.google.com with SMTP id v24so17994636ybd.10 for ; Thu, 02 Jan 2020 15:40:50 -0800 (PST) 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=rcedzx83wuG7WNoojQLgtEnJYNmboi0kK74Rq4i+j6c=; b=lc9JOoglY77IzeDo8hNG8H6AhG1a/bhuva1BstAFb8/rhL62h35ibbDXFg4q9tqHtN 2YWtKdQaF7fw4PbmHAvGxWLu7oi9LIlA6KA/PymbVVZ6wfk9SUZYmmOK4S/IhVTQ6f0k mjIvwAtbkwnETztzcpSbgAvMpdEHLsJnGDF/875IYuxkcNYFr3xK8DFA+qYMStAuUGD6 q8rWfcK8HtgC45grBr6R1Q4v1GgY1G1gcgvKJNMyiHGktyUna5Sb7hyky0uxG1074DU+ n0ie+SXrptwcD0Yc/d6AvcjUsPK7HkpPQ4O3d328gyUIsP1YcCwY1k3tU0/rshEn3MYa GIuA== 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=rcedzx83wuG7WNoojQLgtEnJYNmboi0kK74Rq4i+j6c=; b=o1AVNnGOoxVhyoRdw37Ex5E2Vr1cTPrDcB41aLtmZDjAAOqfmav/gZ88M00aMlAOWk wvbFzhrE6yCebt4WRjKREVk2FXjo9yFbWCu7svabI4tq+LXARBot/KiEBmjABv6NgO8P ImLdUCVK5HizAWLNc0yybPiiMnTlQI8nk2N9/Rb/AokYnKE02bXmDYQP6W50YsMuEknY Sqy+xfNXnwFUxxyMU1sk/HcVqe0Ca6AUL8epLgMUfWYRBPFJnFj/SHJZ32KaYu4UIlEo x2ilC1uh78nTvx++ZeM5cTEEYkq0orHkgL5DcF9dEyzoeUQW4By9sDOaWhv43CdoEDhs iLdA== X-Gm-Message-State: APjAAAWz6i3uzAuoYPMzdBNT29vjes9x4hQz2hH3XQajNsCeqXTQxxOV YZVbpjJNH5Xaz2kkzrypHNCQ1g== X-Google-Smtp-Source: APXvYqz5Qxw3GtAQ0/utIw3aOmGe55hIAoXAMnKXvPL+uWVjSRFvG0uy5mMeoQIZQvG5mhof0OaawA== X-Received: by 2002:a25:e681:: with SMTP id d123mr47857118ybh.292.1578008450127; Thu, 02 Jan 2020 15:40:50 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:1c7e:4985:19af:a36a? ([2601:c0:c680:5cc0:1c7e:4985:19af:a36a]) by smtp.gmail.com with ESMTPSA id e131sm22519470ywb.81.2020.01.02.15.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jan 2020 15:40:47 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Thu, 2 Jan 2020 18:40:46 -0500 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <2AE3CDDB-6882-405E-BCFB-F17EE481A238@newclarity.net> References: <5e0d723f.1c69fb81.e2ae8.24e2SMTPIN_ADDED_MISSING@mx.google.com> <74F2DBFC-E63C-428C-A37F-2D0CEE15AD0F@newclarity.net> To: Bruce Weirdan X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] Initializing constants once, with code? From: mike@newclarity.net (Mike Schinkel) > On Jan 2, 2020, at 6:14 PM, Bruce Weirdan wrote: >=20 > There's also a fourth approach that does not involve any changes to > PHP: autoload + eval. > When PHP is looking for your class, in your autoload you load the > values from config, generate the class source and eval() it. Yes, I guess that would technically be possible. =20 But I think in this case =E2=80=94 dynamically generated code, lack of = type safety and inability to version control and statically analyze the = code =E2=80=94 the proposed solution would be worse than the fallback = position of not using constants. -Mike=