Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119874 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69170 invoked from network); 10 Apr 2023 19:12:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Apr 2023 19:12:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 052BA180503 for ; Mon, 10 Apr 2023 12:12:41 -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=-0.2 required=5.0 tests=BAYES_40,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: AS398810 136.175.108.0/24 X-Spam-Virus: No X-Envelope-From: Received: from mail-108-mta80.mxroute.com (mail-108-mta80.mxroute.com [136.175.108.80]) (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 ; Mon, 10 Apr 2023 12:12:40 -0700 (PDT) Received: from mail-111-mta2.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta80.mxroute.com (ZoneMTA) with ESMTPSA id 1876c9597a5000edb4.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Mon, 10 Apr 2023 19:12:35 +0000 X-Zone-Loop: b97ad8298c00ae8dce59c5c9160ece76f88609633eae X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sandfox.me; s=x; h=MIME-Version:Content-Transfer-Encoding:Content-Type:References: In-Reply-To:Date:To:From:Subject:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=w+bzmQZ0BPR/gh9i8rMLgEW0n80nJAGSS2kJXDDK9TQ=; b=YRLt5zvc2fkZv75e9CXtE4UBpr MYpgYEhmeE1jIBXn0oanZbubo3vAnEkExYTa2X6DbIctNNKIsBDVFqYs9V1+y2UGZ9W2m+jhxRnB2 1fnwtMLUQFG9oBibq9Stqy0T2QSg43fHou5e2xndqPE9esF4RjLrY0QaiVWchz+/DP7OhhmvkycLD /odApTIhjK4q6I+zfpwR1ZcUBsI79uE1bn+xEh8WA7L+pXYgxO+G3vZf99RpbYAnOkQpAJOqDXx0t om8AHcfOrXG2rtBvQgoP3XObNJgYM1zwCUTqIgDFD+TaAGo3z9AX2Mz3A+SAvv0FpbMYhf8Zua9zy 0PpwiDDA==; Message-ID: <7fe2339ed7ba287811e9437d029696a9b9d8a332.camel@sandfox.me> To: internals@lists.php.net Date: Mon, 10 Apr 2023 22:12:31 +0300 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Authenticated-Id: sandfox@sandfox.me Subject: Re: [PHP-DEV] [RFC] New core autoloading mechanism with support for function autoloading From: sandfox@sandfox.me (Anton Smirnov) Hello George, I'm not sure I'm 100% correct but I think that this RFC still allows to call different functions for the same code, just not in the same run. Consider this pseudocode: //- funcs.php namespace My; function myfunc(...) { ... } function array_map(...) { ... } //- code1.php namespace My; myfunc(1); // autoload triggered // bonus points if it's a different file or some obscure method array_map(strlen(...), []); // My\array_map //- code2.php namespace My; // no prior autoload array_map(strlen(...), []); // global array_map And if I understand the current order of execution correctly, here is a more extreme example: //- moreextreme.php namespace My; if (some_random()) { array_map('My\myfunc', []); // global array_map } else { array_map(myfunc(...), []); // My\array_map } --=20 Anton