On Tue, 24 Jul 2007 11:53:38 -0700
[EMAIL PROTECTED] (Stanislav Malyshev) wrote:

> > Where I can see a huge use for namespaces is plugin-based architectures.  
> > Each 
> > plugin is its own namespace.  If you have a list of plugins, then you have 
> > a 
> > list of namespaces and can iterate over that and invoke the same operation 
> > on 
> > each plugin.  That would require call_user_func() and 
> > call_user_func_array() 
> > and the rest of that family to be able to handle namespaces.  How would one 
> 
> Since namespace is just a part of class name, I don't see any problem 
> for call_user_func() to be able to use namespaced names. Of course, they 
> should get full class name - if you want to use shorter ones you'd have 
> to change something. Here we might need some functionality, but it's not 
> clear to me yet which one.
> 
> 

w/ snapshot from yesterday:

[EMAIL PROTECTED] /usr/local/src/php6.0-200707232030 $ cat ./namespace3.php 
<?php
namespace test;

class Blah { static function test() { echo "Test\n"; } }

call_user_func(array(__NAMESPACE__.'::Blah', 'test'));
?>

[EMAIL PROTECTED] /usr/local/src/php6.0-200707232030 $ ./sapi/cli/php 
./namespace3.php 
Test


Andrew Minerd
Software Architect
The Selling Source, Inc.

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

Reply via email to