Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107974 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 41343 invoked from network); 3 Jan 2020 16:44:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jan 2020 16:44:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EAD88180505 for ; Fri, 3 Jan 2020 06:48:34 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (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 ; Fri, 3 Jan 2020 06:48:34 -0800 (PST) Received: by mail-il1-f170.google.com with SMTP id p8so36751581iln.12 for ; Fri, 03 Jan 2020 06:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=LHsp80uFUTNjZmNnlvXXhJHVkryMwAlQJRK77LKG88Q=; b=bH87jmLlGsff2n/0zi26sRTAPgtV4YgRVL/EnN6hDlV0y1Ol6XmFzGrTlHKmySbzT0 YRNmAuazVD5m9XuajN5Pfxw28aJZe0FDhvA5Jk0QeXHg2BK/XanZ4ixYRUL2u/TJAFE/ YpBhNsBN2OOjOiUHqz0dJwmcISRQ8VYds0L8660+Eknu9THntqn6Yum+0rIs8c6I8bWL Ftb0dvtVllluUHjk8gKOBKb8kX8uwj/PfPDivMtYn8X2YtZaRqfyE9altYo+aM/gxEpl f0Sx8uSqfX+LdGvwmMYGVIp7j3OM8q2NCnqyyzkXgzLTigqbymy3YkMdg/shaJWHszov EenA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=LHsp80uFUTNjZmNnlvXXhJHVkryMwAlQJRK77LKG88Q=; b=s4bHBt1M3hc6LLncEWUnTxNVqegBs9NdlvlcxMEVmhTKwwENjM8msJ7va/8xE4vT8q uuJWLoZSDNVKGqze0c3PKiz7C0y1X/bcl8GgSUqjTbMubp/BWQgpcZOd+eKU+vz777hw hSWn3EodJ0KOtMTz/irCRCpEGbzkvTmdzGz5MyAwEtyX67OrJpwjJHIgoxjgIwjyZgug L9uCJRq+aSvaJIOkZmLZUoS64ypFx/UdxCjnNKXf19/DyAs5ReR9AoZWeWIN4VdfNMN6 +a9EZ4yxhJVSCkegxnIb+pYc0PrmFNVw6bQVd7cm9h5pup3ivRdKzQAj9bWIA94oNvjY wOtA== X-Gm-Message-State: APjAAAUhSqC2wc7/vlmJ5pXqErnATLrPqX72tt2v2yJZ27e7z8+nSiTx FEZwiI7lAHmC+q75atpH3zWbkJe+1YjeSdV/J95jRptx X-Google-Smtp-Source: APXvYqy9k3CJsRmKyZJQfBc3rJY0jBtd3oG8hDP5IgIuLEWzq34zMMqRa3ln/lvoYCWgvTxF+UHM4lH/p92NGHY62m4= X-Received: by 2002:a92:7606:: with SMTP id r6mr74059364ilc.120.1578062912127; Fri, 03 Jan 2020 06:48:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 3 Jan 2020 14:48:21 +0000 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="0000000000004f85e5059b3d67b8" Subject: Re: [PHP-DEV] Autoloading functions/consts without a performance impact From: rowan.collins@gmail.com (Rowan Tommins) --0000000000004f85e5059b3d67b8 Content-Type: text/plain; charset="UTF-8" On Fri, 3 Jan 2020 at 11:37, Nikita Popov wrote: > Overall though, I do tend to agree that the use of static methods is at > this point more idiomatic than the use of free-standing functions, and it > might make more sense to go in that direction. > Perhaps a way forward would be to effectively abandon namespaced functions as a language feature: * Implement https://wiki.php.net/rfc/use_global_elements * Plan to eventually make "use global functions" the default * Revive the "static class" modifier, which was rejected under https://wiki.php.net/rfc/abstract_final_class primarily on the grounds that "namespaced functions should be used instead" * Add a "use function A::foo" syntax that requires the target function to actually be static Namespaces containing only functions and constants could then be replaced by autoloadable classes. However, if we're looking at radical changes of direction, I wonder if we should instead plan to phase out autoloading itself. With OpCache and now pre-loading, the idea of "only include the files you need" makes much less sense than it did ten years ago. OpCache on the command-line is probably used much more rarely, but given how easy it is to incidentally pull in dozens of classes from a third-party library, maybe that's something that should change? Regards, -- Rowan Tommins [IMSoP] --0000000000004f85e5059b3d67b8--