Stan Vassilev | FM wrote:
use foo\bar\*;
$a = new A();
$b = new B();
...
I may be asking this question out of ignorance, but here goes:
What is the difference between the following snippets?
// global.php
use \foo\bar\*;
$a = new A();
$b = new B();
// namespaced.php
namespace \foo\bar;
$a
Johannes Schlüter wrote:
On Thu, 2008-11-06 at 22:19 -0600, Josh Thompson wrote:
I don't understand why in the namespaced example no one seems to have a
problem with new A() meaning new \foo\bar\A(), but we can't use the *
wildcard to do the same thing?
Since we don't re
Greetings All,
Intro
=
The discussion over type hinting seems to be getting divided between
those who really like it (most likely the ones who write strongly typed
programs anyway) and those who don't want to add yet another kind of
type system to PHP.
I have been thinking about it and
troels knak-nielsen wrote:
1) It covers all the use cases for a type-based system (You can use
`is_integer` as a contract, if you want that)
2) It's extensible in user-space, which means that it can be used to
convey much more accurate information, relevant to the application
needs.
3) It's focus
troels knak-nielsen wrote:
- How do you know if it is a contract or the current object type hint?
The simplest solution would be to make one take precedence. You're not
likely to have both a class and a function with the same name, and if
you do, you kind of had it coming to you. For backwards
Lukas Kahwe Smith wrote:
> On 10.07.2009, at 13:20, Lewis Wright wrote:
>
> >> 3) function Foo(is_int($x)) {
> >>
> >> Function is_int is called, an error is raised if it returns false.
> >>
> >
> > But then you're complicating it to the point where it's no longer
> > much more
> > useful