Re: Class names (with regard to autoload)

From: Date: Thu, 26 Feb 2009 21:51:39 +0000
Subject: Re: Class names (with regard to autoload)
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-43194@lists.php.net to get a copy of this message
On Thu, Feb 26, 2009 at 8:48 PM, Guilherme Blanco <guilhermeblanco@gmail.com> wrote: > I doubt you'll find a patch to it. > > Mainly, the patch will be against this principle: > <snip> Hmm, that wouldn't actually have an impact, as (at least, what I'm aiming for/wanting to do) is not to introduce periods as valid in actual class names, but to allow them to be used for autoloading - so I can have something like this (abbreviated terribly, apologies): function __autoload($sFoo) { include(str_replace(".", "/", $sFoo)); } .. so, your example would expand to Foo.Bar, which given that periods aren't allowed in a class name doesn't exist as a class, and won't work. Unless I'm missing something? Actually, I don't believe that expanding is even done - i.e. it doesn't respect defines there Seems that way on testing, too: class FooBar { // ... } define('Part', 'Foo'); define('SubPart', 'Bar'); $fb = new Part.SubPart(); gives: Fatal error: Class 'Part' not found .. but that part of things is a going off on a bit of a tangent.

« previous php.internals (#43194) next »