Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97888 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3133 invoked from network); 20 Jan 2017 07:04:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2017 07:04:53 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.161.182 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.161.182 mail-yw0-f182.google.com Received: from [209.85.161.182] ([209.85.161.182:34636] helo=mail-yw0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 80/02-00729-096B1885 for ; Fri, 20 Jan 2017 02:04:53 -0500 Received: by mail-yw0-f182.google.com with SMTP id w75so73271885ywg.1 for ; Thu, 19 Jan 2017 23:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=mvLbW8cjrrAzKYD4VdO92ulYskVMhJ3AgzVaevuRa9o=; b=Z8XGMVVWdr9MOYumHfFLbBtcVSM6ZRYC1mc0zXwvJ3Z+6MDGxb4i007knzxpF5qSks hlJRQTfg1efADNAyb3+qnUnVfFasf//DMImNxOmFXOT3bCJh718dp9nOCDgqXXsED2Ae k2QHHjDLUnPDYrB/IpUix0VehhzOp0zZfIlt6mV3ItGsGNOK3Mxj9UXCWzNc3LQC2Vex EBbXr7nxHNrFBucVKcH5RLPwsB8bHBbiTPbYDxhFz1n4D757opI7N7SZUDsdTO0gwG4N ogTyP+q1Br8epQ5j/+aX/lUc6uWAhrroJrnD6e/Y+x+9pdGQlUbsRjOiO2C0ExQfsNVg x6Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=mvLbW8cjrrAzKYD4VdO92ulYskVMhJ3AgzVaevuRa9o=; b=BA1ujZoD1ZjTHVrYKkIJJzQTas4hgbaa1/Z2v2ZLsP4WkEcq7SKQoFcPITUPP2RLWK 3Ye3dCJbRLRM9kzzFtHL4CwnpbytPm15v9ZwN8xzKiObDC6RVnKgRZwzW6g6WJvZ/9/s cOjXi01rM22+fy3zkhI6xjlm4VtwMplDZzpjIVxgabNGSOA1eNl1tVktDj09bsqViVWW +B70E3rjoXfg094otvQfwGiF00CqSbr1sAZQzZQTlJfir/pWypp4vWJ588RWWNJ+vaQD gUcRPWaCy5wxmh8RFyTIalXiolqDTZ2Wge2FEDhhGDszibhaRnLT3O8hMs00ulFFNqEd U9GQ== X-Gm-Message-State: AIkVDXI7+VLledYM2GES/Sa3GbWu3R5BBuYxDzTWd4Q5Sfxf0AkVoqIak6Fap6+aYkkqwB5OiIrmja5y6DMcaA== X-Received: by 10.200.44.236 with SMTP id 41mr10570632qtx.267.1484895885242; Thu, 19 Jan 2017 23:04:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.47.231 with HTTP; Thu, 19 Jan 2017 23:04:44 -0800 (PST) Date: Fri, 20 Jan 2017 08:04:44 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=001a11404342c4e35f05468143cc Subject: Not autoloading functions From: rasmus@mindplay.dk (Rasmus Schultz) --001a11404342c4e35f05468143cc Content-Type: text/plain; charset=UTF-8 Just a quick thought. Since the autoloading functions proposal is stalled, how about allowing for import of static functions instead? use function Foo::bar; bar(); // calls Foo::bar() There are two benefits to this approach: 1. There is immediate support for autoloading without any need for adoption or support in existing autoloaders. 2. Pseudo-namespaces (abstract classes with stateless static functions) are already widely practiced in PHP - a lot of existing code would be supported as is. The syntax when calling functions would be the same. If we had function autoloading, we would likely collect related functions in a file anyway - putting them in a class instead gives more less the same exact result. The only drawback I can see, is the inability to import a whole set of functions with one statement - but being explicit about external imports is widely considered best practice for classes and interfaces, so why not for functions. Yeah, it's a bit inconvenient, but at least we can move ahead and leverage existing code without changes or BC breaks. It's not all bad. It's better than nothing perhaps? :-) Thoughts? --001a11404342c4e35f05468143cc--