On Sun, 8 Jul 2007, Dmitry Stogov wrote:

> Note that multiple files in namespace won't allow autoloading.

That got me confused a bit. I was wondering whether the following would 
work (with autoload):


In file "a/b.php":

<?php
namespace a;
class b { }
?>

in file "a/c.php":

<?php
namespace a;
class c { }
?>

In file "a/d.php":

<?php
namespace a;
class d { }
?>

in file "a/e.php":

<?php
namespace a;
class e { }
?>



in "index.php":

<?php
function __autoload( $className )
{
        include str_replace( "::", "/", $className ) . ".php";
}

$b = new a::b;
$c = new a::c;

import a;

$d = new d;
$e = new e;

?>


regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to