2009/2/26 Robin Burchell <virot...@viroteck.net>

> Hi all,
>
> I've been playing around with autoload lately, and specifically using
> autoload to load classes which may be in subdirectories. I came up
> with the following test script:
>
> <?php
>
> function __autoload($sName)
> {
>        echo "autoloading " . $sName . "\n";
> }
>
> $s = "Foo.Bar";
>
> $a = new $s();
> $b = new Foo.Bar();
> ?>
>
> The first line demonstrates what I'm after ("autoloading Foo.Bar"),
> and the second seems to give a bit of an odd/incorrect (in these
> circumstances) result(__autoload is invoked with "Foo").
>
> Is it possible to reconcile this behaviour to be a bit more
> consistant, and provide the behaviour I'm after?
>
> I'm willing to try provide a patch, if someone would be kind enough to
> direct me to the part(s) of the engine I'd need to look at.
>

The concatenation operator (.) is not valid in a class name. Use an
underscore and you'll be able to get the behaviour you want.

-Stuart

-- 
http://stut.net/

Reply via email to