Re: AW: [PHP-DEV] Importing namespaced functions

2013-04-24 Thread Pascal Chevrel
Le 24/04/2013 08:15, Martin Keckeis a écrit : Hello together, if you got a namespace with more than one functions, why not just create a container class and make the methods static? I know it's not exactly the same, but how many times you need this So you can write: namespace Abc\Def; clas

Re: AW: [PHP-DEV] Importing namespaced functions

2013-04-24 Thread Alexander Deruwe
On Wed, Apr 24, 2013 at 10:54 AM, Florian Anderiasch wrote: > Additionally, it's either semantically wrong to group unrelated > functions in "static tool classes", it's even a well-known antipattern. It also doesn't address a point made by Igor before: "It's distracting to have my vendor name

Re: AW: [PHP-DEV] Importing namespaced functions

2013-04-24 Thread Florian Anderiasch
On 04/24/2013 08:15 AM, Martin Keckeis wrote: > class Something{ > public static function blubb(); > > public static function blubb2(); > } > > > use Abc\Def\Something; > > Something::blubb(); > Something::blubb2(); Yes of course you can do that as an ugly workaround - but I wouldn't c

Re: AW: [PHP-DEV] Importing namespaced functions

2013-04-23 Thread Martin Keckeis
Hello together, if you got a namespace with more than one functions, why not just create a container class and make the methods static? I know it's not exactly the same, but how many times you need this So you can write: namespace Abc\Def; class Something{ public static function blubb();

Re: AW: [PHP-DEV] Importing namespaced functions

2013-04-23 Thread Daniele Orlando
+1 The current behavior is really annoying. 2013/4/22 Florian Anderiasch > On 04/22/2013 12:55 AM, Robert Stoll wrote: > > I agree with Igor. The readability could be improved and I do not see the > > problem of hiding built-in php functions (however, I would not recommend > > it). > > I would

Re: AW: [PHP-DEV] Importing namespaced functions

2013-04-22 Thread Florian Anderiasch
On 04/22/2013 12:55 AM, Robert Stoll wrote: > I agree with Igor. The readability could be improved and I do not see the > problem of hiding built-in php functions (however, I would not recommend > it). > I would say, if someone hides the normal php built-in function then he or > she is doing that o

AW: [PHP-DEV] Importing namespaced functions

2013-04-21 Thread Robert Stoll
] Importing namespaced functions Let me give you two specific cases where I think importing a function significantly improves the readability of code. A) Tiny libraries I recently released a "library" that really just consists of two functions. Those functions are named compose() and pipeline(

Re: [PHP-DEV] Importing namespaced functions

2013-04-21 Thread Igor Wiedler
Let me give you two specific cases where I think importing a function significantly improves the readability of code. A) Tiny libraries I recently released a "library" that really just consists of two functions. Those functions are named compose() and pipeline(), and the library is named "igorw/c

Re: [PHP-DEV] Importing namespaced functions

2013-04-20 Thread Igor Wiedler
> What's wrong with referencing one part of it? It can be as short as two > characters, and an an added bonus you won't suddenly have your strlen > overridden by somebody without you knowing it. Functions live in global > space, and there's a real lot of them, that's why importing them wasn't > con

AW: [PHP-DEV] Importing namespaced functions

2013-04-19 Thread Robert Stoll
You can import a namespace and use an alias. For instance use com\example\cms as c; c\foo(); -Ursprüngliche Nachricht- Von: Christoph Rosse [mailto:cro...@2bepublished.at] Gesendet: Freitag, 19. April 2013 14:48 An: internals@lists.php.net Betreff: Re: [PHP-DEV] Importing namespaced

Re: [PHP-DEV] Importing namespaced functions

2013-04-19 Thread Christoph Rosse
On 19.04.2013 08:19, Stas Malyshev wrote: Hi! One of the shortcomings of namespaced functions in PHP is that it is not possible to import them as you can do with classes and namespaces. For code that is not in the same namespace as the function, you must always reference at least one part of th

Re: [PHP-DEV] Importing namespaced functions

2013-04-18 Thread Stas Malyshev
Hi! > One of the shortcomings of namespaced functions in PHP is that it is > not possible to import them as you can do with classes and > namespaces. For code that is not in the same namespace as the > function, you must always reference at least one part of the > namespace in order to call it. W

[PHP-DEV] Importing namespaced functions

2013-04-18 Thread Igor Wiedler
Hello internals, One of the shortcomings of namespaced functions in PHP is that it is not possible to import them as you can do with classes and namespaces. For code that is not in the same namespace as the function, you must always reference at least one part of the namespace in order to call