Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54198 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62484 invoked from network); 26 Jul 2011 08:35:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2011 08:35:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=catch56@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=catch56@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: catch56@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-ew0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:33248] helo=mail-ew0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/71-48186-B5C7E2E4 for ; Tue, 26 Jul 2011 04:35:41 -0400 Received: by ewy2 with SMTP id 2so210024ewy.29 for ; Tue, 26 Jul 2011 01:35: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; bh=G/MCY5GiyT4CLao3XAQJMaoEy69j0JRC9MMQpVkCd7o=; b=OO7Rib9b7ngUVSCAbLbVYCXO31i7R5sRf9SI30Y4m3IeBlc9oTtJT2FTO+o5E5MhK7 gApfRweO9h+2jAheFsgPa0cvG2KXL6LKs4PWyOdNWTWICqmyhRAZDHdBwiSXhbE9Zi4k jUAUv9W2uCdRogmaDMLpp0ujXpk1nOTU+Oq78= MIME-Version: 1.0 Received: by 10.204.55.199 with SMTP id v7mr1822940bkg.83.1311669335538; Tue, 26 Jul 2011 01:35:35 -0700 (PDT) Received: by 10.204.78.81 with HTTP; Tue, 26 Jul 2011 01:35:35 -0700 (PDT) In-Reply-To: <4E2E784F.4050307@googlemail.com> References: <4E2E784F.4050307@googlemail.com> Date: Tue, 26 Jul 2011 17:35:35 +0900 Message-ID: To: sebastian.krebs.berlin@googlemail.com Cc: PHP internals list Content-Type: multipart/alternative; boundary=001636c5a90ccebe4a04a8f4d08c Subject: Re: [PHP-DEV] Function/Constant autoloading From: catch56@gmail.com (Nathaniel Catchpole) --001636c5a90ccebe4a04a8f4d08c Content-Type: text/plain; charset=ISO-8859-1 There is lazy loading for functions via apc.lazy_functions (although I've not properly tested this yet). That doesn't require any userspace code changes. For define() I'm not aware of anything allowing for lazy loading constants (define() is just a function call). However there are a few approaches for avoiding define(), you could look at apc_define_constants(), http://pecl.php.net/package/hidef and http://pecl.php.net/package/chdb, you could also switch to class constants and lazy load your classes. I haven't On Tue, Jul 26, 2011 at 5:18 PM, Sebastian Krebs < sebastian.krebs.berlin@googlemail.com> wrote: > Hi, > > Maybe this topic occured already, then sorry when I'm wasting your time, > but I'm wondering, why there is no autoloading for functions and > (namespace)constants. > > When a class is not found, then an userland function is called. Thus I > don't see a reason, why something like this doesn't exists for functions and > (namespace)constants too, because using them is quite uncomfortable right > now compared to classes and the decision _how_ to load them would be on the > developers-side anyway. > > Sebastian Krebs > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001636c5a90ccebe4a04a8f4d08c--