Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68273 invoked from network); 26 Jul 2011 08:53:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2011 08:53:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:60540] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/82-48186-1908E2E4 for ; Tue, 26 Jul 2011 04:53:38 -0400 Received: by gxk27 with SMTP id 27so117968gxk.29 for ; Tue, 26 Jul 2011 01:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=mqov81fwHi6GMkor3G85+d2NRliJK2H9gh41KBMHgjw=; b=fltTd2v5hTuyvAdCj+VM2ZrG3ZglNzCiMlnOwqDqmJloXoc2gC4KFDd0QKPtq2/ZbF nsC+ML/r9hFOZInrDDuVeiFtMHdyPOb26wdnP94xVFRyXiGInkFIBpVlg4AtY/gnAsOz GwXW3gW/GA2WmCc0XMmfalDGeiCFqmiUoAxNI= MIME-Version: 1.0 Received: by 10.146.30.26 with SMTP id d26mr4893822yad.25.1311670414810; Tue, 26 Jul 2011 01:53:34 -0700 (PDT) Received: by 10.146.84.20 with HTTP; Tue, 26 Jul 2011 01:53:34 -0700 (PDT) In-Reply-To: <4E2E7D5F.9090908@googlemail.com> References: <4E2E784F.4050307@googlemail.com> <4E2E7D5F.9090908@googlemail.com> Date: Tue, 26 Jul 2011 10:53:34 +0200 Message-ID: To: sebastian.krebs.berlin@googlemail.com Cc: PHP internals list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Function/Constant autoloading From: tyra3l@gmail.com (Ferenc Kovacs) On Tue, Jul 26, 2011 at 10:39 AM, Sebastian Krebs wrote: > Hi, > > thanks for your reply, but I'm not talking about class loading (because > thats already possible). I'm talking about autoloading of userspace > functions and constants > > > // /path/to/my/functions.php > namespace my\functions; > > const THING =3D 'I am constant!'; > > function helloWorld () { > =C2=A0 =C2=A0echo "hello World; > } > > // /path/to/some/other/file.php > namespace foo; > use my\functions; > > functions\helloWorld(); // fail! > echo functions\THING; > > I think it's pretty clear what are you after. autofunc with a patch: http://www.mail-archive.com/internals@lists.php.net/msg43983.html __autodefine proposal and rfc: http://www.mail-archive.com/internals@lists.php.net/msg48986.html https://wiki.php.net/rfc/autodefine?s[]=3Dautodefine from the replies I think that the idea didn't got traction from the core d= evs. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu