Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94119 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19213 invoked from network); 19 Jun 2016 13:00:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2016 13:00:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=davidkmuir@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=davidkmuir@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.178 as permitted sender) X-PHP-List-Original-Sender: davidkmuir@gmail.com X-Host-Fingerprint: 209.85.192.178 mail-pf0-f178.google.com Received: from [209.85.192.178] ([209.85.192.178:35759] helo=mail-pf0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CD/5A-18862-95796675 for ; Sun, 19 Jun 2016 09:00:10 -0400 Received: by mail-pf0-f178.google.com with SMTP id c2so45245952pfa.2 for ; Sun, 19 Jun 2016 06:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yYjTB6+3kf9QVozvjrN4gkhsS/RjM1PNt3o84TTmQKs=; b=R/ATq1a0i2BWi6JnJ1MIdE881v3yudFaUsiUKuy6DLKUJoINUfAPBQkyy1QnQzx8tI IDJ7F6uBdLUgbpc0UdaIFIpVZVlgT8b5nqhIr1KivjzJ6tXehKlTbCqQca3TLZWvCfpJ x7bSk6f9lJxw4X25d37ZGvN4ZuwXSpFz5gKX97sTFUa/aJUjPcxNDQr1nHDc/mswG9dr cSw70KvmPqIWtU7eDIgTZCoufrv2zKp9kPikaHJrNto4bxZZnGDohp8bVzY1Omnr8vDk 8oNy0GbmpDJFKhevje/sxZlrtH5QcqGfAs7xwlHQsvqi5BboZZiIogZ1RN8E21NUF0MG lzEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yYjTB6+3kf9QVozvjrN4gkhsS/RjM1PNt3o84TTmQKs=; b=kQ5h1lokYP3zctxHJ43OC87fNKFX//l8JqDHtQM4nk2pc6i7GiO1CL4LUaG6KGUuF1 0UsMSDgMSeIaA2zi3126zUTXbUiobzJsn8G/FUou4O4ToyN+aHQXlAlOKKjj0bYwFYV3 uRxFT9PePPFr/8UWZrBWiO+YVS4lqr7LApQmn214MnrrGSfszIaUYQbjyR1DNCz00xkD L0Tm9Vk3G+1oFCvawF8her8OGja4cwpUFwejmdEOL386enaaInJxihb4xteJUlNlHAJR qClcWaS4OJRTRTf8gGXSA6wxP+peTERCzeR7E6aw72aUIQGw1Lbks/6SKjNeeryGgysO iA+A== X-Gm-Message-State: ALyK8tJhoa3QYTbBwzwSNm9MU1Plf2RPu1ruCCkzS0GdiEjca4Mi4wkTMbowHWsbTabMRQ== X-Received: by 10.98.109.134 with SMTP id i128mr15039619pfc.72.1466341201598; Sun, 19 Jun 2016 06:00:01 -0700 (PDT) Received: from [192.168.0.9] ([115.69.40.69]) by smtp.gmail.com with ESMTPSA id o12sm40905958pfg.10.2016.06.19.06.00.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 06:00:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (13F69) In-Reply-To: Date: Sun, 19 Jun 2016 22:59:58 +1000 Cc: Marco Pivetta , Niklas Keller , Ryan Pallas , Stanislav Malyshev , Thomas Bley , "internals@lists.php.net" , michael.vostrikov@gmail.com Content-Transfer-Encoding: 7bit Message-ID: <2FE6EEAB-FAA4-4449-A443-08C2C0D28AB4@gmail.com> References: <20160617202344.2868F1A80C02@dd1730.kasserver.com> To: Rasmus Schultz Subject: Re: [PHP-DEV] New escaped output operator From: davidkmuir@gmail.com (David Muir) > On 19 Jun 2016, at 7:57 PM, Rasmus Schultz wrote: > > I am well familiar with this approach, and it does not scale - not > only would you be aggressively loading every installed view-helper > anytime you render a view, you would even be loading them when you're > *not* rendering a view. > > I'm afraid the best we could do at this point, without changing the > language, is a establish a convention for autoloading functions > (and/or namespaces of functions) from files, based on static analysis > of template files. > > But that is pretty complex - on the organizational side, it requires > developers to agree on and adopt a convention, and on the technical > side, you need static analysis and thereby most likely a cache layer > as well. > > It's all possible, but most people aren't going to put up with this > much complexity for something this simple. > > Hmm. What if we could import static methods into file scope and use > them as functions? > > use My\Namespace::my_function; > > my_function(); // <-- effectively My\Namespace::my_function() > > This would leverage auto-loading at least... I mean, it's still > effectively just abusing classes as pseudo-namespaces, so there is > that - but it would work with e.g. Composer right away, and probably > with many existing static classes? > > Yeah, it's still ugly... > > Ugly, but brilliant! +1 David