Stanislav Malyshev wrote:

>>  If functions in namespaces won't have the same treatment or features as
>> classes why bother ;)
> 
> Functions can't have the same features as classes, because then they'd
> be classes :)

That's not what I meant and you know it (sighs)

Bottom line, being able to alias in functions the same way you can
classes would be useful.  You could also shoot yourself in the foot.

You can alias in classes.  You can shoot yourself in the foot with that
as well.

You can do lots of bad things to yourself in PHP (I'm just waiting until
goto hits...) - I just think that it would be nice to have a common
function (personal use case - a library string translation function)
that could be called over and over again without having to add the
namespace before it.  The other thing this would solve is issues with
ambiguity in namespacing.

<?php
namespace foobar;

function printme{}

class foobar{
static public function printme {}
}
?>

<?php
use foobar::printme as globalprint;
use foobar::foobar;

foobar::printme();
globalprint();
?>

Granted, that's stupid design.  But someone is going to do it, and it is
a workaround rather than forcing the redesign of all the code.

Anyway, this is just one of my issues (and a rather small one) with
namespaces.  Can we get back to autoload problems? (and no text before
opening <?php with a namespace)  And three million use statements?

Thanks,
Elizabeth




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

Reply via email to