Re: [PHP-DEV] Re: Order of class resolution with namespaces and autoload

2007-10-19 Thread Chuck Hagenbuch
Quoting Gregory Beaver <[EMAIL PROTECTED]>: Are you suggesting there be namespace-specific autoload? This sounds interesting to me, but also quite complex, not sure the benefits would outweigh the difficulties for implementation. For instance, PEAR2 namespace would be different from PEAR2::Som

[PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-19 Thread Chuck Hagenbuch
Hi folks- I've hit upon something with namespaces and autoloading that I think is a little out of order. If you take the attached 3 files, put them in the same directory, and run demo.php, you will see this: Fatal error: Uncaught exception 'Exception' in /Users/chuck/Desktop/test.php:7 If

Re: [PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-20 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: If it worked this way, you couldn't easily use global classes and old applications would be much harder to convert to namespaces. We think that using global Exception is much more frequent than defining your own Exception - and in the latter c

Re: [PHP-DEV] Re: Order of class resolution with namespaces and autoload

2007-10-20 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: This is even better than requiring, and makes the intent very clear. I don't think it decreases intuitiveness, on the contrary - from the look of the code it is immediately clear which exception would be used. Except that it makes it unc

Re: [PHP-DEV] Re: Order of class resolution with namespaces and autoload

2007-10-20 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: Except that it makes it unclear what happens in _other_ files, which is In other files you specify what happens to other files. even worse. Once you include the file above, any other file in the Test:: namespace that throws an Exception will t

Re: [PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-20 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: Not entirely correct - namespaces needed to reconcile _multiple_ libraries, while in case of Exception you need to stay away only from _one_ set of classes - namely, internal ones. While indeed even that could be inconvenient, the problem is t

Re: [PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-20 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: Because if you say "Exception" inside any namespace, we should check if Foo::Exception not exists anywhere, which means full search of all autoloading possibilities. Only after we ensured that no such class exists anywhere, we might use Except

Re: [PHP-DEV] Re: Order of class resolution with namespaces and autoload

2007-10-20 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: ... which is correct as far as it goes, there are no side effects. However, if I flip the include order, including 1.php before 2.php, then I get this: Test::Exception Test::Exception Of course, since once Test::Exception is defined, Excepti

Re: [PHP-DEV] Re: Order of class resolution with namespaces and autoload

2007-10-20 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: This is even better than requiring, and makes the intent very clear. I don't think it decreases intuitiveness, on the contrary - from the look of the code it is immediately clear which exception would be used. I went ahead and tried to apply

Re: [PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-20 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: But you shouldn't even look for Exception then. I'm saying that if you want the global Exception class you should import it. That would be double bad - that means you have to go over all your code and add :: to all instances of global classes,

Re: [PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-21 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: "import PHP" is a no-op now. However, I have another idea about it (besides the fix for the import thing that indeed looks like a bug to me) - what if we add some syntax to say "use this namespace" which would use autoload, so you'd say: nam

Re: [PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-21 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: I'm not sure I follow you. If you intend to always use internal one, why you define the local one? If you sometimes intend to use one and sometimes another - I propose you a way to ensure the right one is always used, this without using potent

Re: [PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-22 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: import Exception; -> name conflict, which seems correct import Exception is a no-op, so I don't understand how you could have got name conflict. Do you mean "import Test::Exception"? That should work, if it didn't it's a bug. It turns out t

Re: [PHP-DEV] Order of class resolution with namespaces and autoload

2007-10-22 Thread Chuck Hagenbuch
Quoting Stanislav Malyshev <[EMAIL PROTECTED]>: Yes. I think that if you use an unqualified name it should always be relative to the namespace (and importing internal classes into your namespace lets you use short names for them, avoiding ::Exception). Unfortunately, there are problems wi

[PHP-DEV] Autoloading namespace constants and functions

2007-10-24 Thread Chuck Hagenbuch
A few different proposals have mentioned the possibility that import or use statements might trigger autoload. My initial reaction is that this would be bad, BUT: it could let us use autoload to handle namespaced function libraries and namespace constants also - as long as they were importe

Re: [PHP-DEV] ignored patches

2007-12-04 Thread Chuck Hagenbuch
Quoting Martin Alterisio <[EMAIL PROTECTED]>: Knowing that I'll have to strongly encourage the developers to dump that patch. The namespace declaration shouldn't do more than what it's expected to do. Why this: namespace yadayada; import yadayada; Should work different that: import yadayada;

[PHP-DEV] Bug #43231

2007-12-27 Thread Chuck Hagenbuch
Could someone please take a quick look at bug #43231 (http://bugs.php.net/bug.php?id=43231)? Johnannes said in mid-November that he had a patch for it but it's been sitting idle since then. Should be a pretty simple issue. Thanks, -chuck -- PHP Internals - PHP Runtime Development Mailing L

Re: [PHP-DEV] Re: Array syntax []

2008-01-11 Thread Chuck Hagenbuch
Guys, there is really no point to argue about aesthetic or taste. Make your point by using +1/-1 and that's it. As said, the trolls quota has been used already. +1 -chuck -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] BC break with callbacks in 5.3

2008-01-30 Thread Chuck Hagenbuch
Quoting Marcus Boerger <[EMAIL PROTECTED]>: actually it was a bug. We, sorry I, did not spot this in earlier versions. Now saying you rely on a bug in PHP 5 to be able to execute PHP 4 code simply does not work. The bug is that with callbacks in PHP 5.3+, E_STRICT is enforced even when E_S

Re: [PHP-DEV] cvs.php.net - horde bugs..

2004-04-14 Thread Chuck Hagenbuch
Quoting Allowee <[EMAIL PROTECTED]>: http://cvs.php.net/co.php/livedocs/README?r=1.14 Notice: Undefined variable: flowed in /usr/home/Web/chora.php.net/horde/framework/MIME/MIME/Viewer/plain.php on line 38 and a link (www.php.net/license) found on that page: http://cvs.php.net/horde/services/go

Re: [PHP-DEV] Re: Construct Request

2004-04-15 Thread Chuck Hagenbuch
Quoting Hartmut Holzgraefe <[EMAIL PROTECTED]>: actualy in this special case i have been whishing for an operator for ages, maybe a modification of the good old ternary: $foo = ?$bar : "default"; or $foo ?= "default"; If this were added, wouldn't it make sense to use the convention alread

[PHP-DEV] Shorter URLs on cvs.php.net

2004-06-14 Thread Chuck Hagenbuch
I've just updated cvs.php.net to use mod_rewrite to allow URLs such as: http://cvs.php.net/pear/Mail/ Old URLs will still work just fine, but the above style is used by default, so if you want to update any website links, you can. Note that for top-level directories, you *must* include the trailin

Re: [PHP-DEV] Re: cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Chuck Hagenbuch
Quoting Jon Parise <[EMAIL PROTECTED]>: The patch, as committed, breaks backwards compatibility in a point release. The proper "fix" is to revert it unless someone has a version that actually works. I committed a change that should avoid the range check if the FT_UID flag is set. If someone could

Re: [PHP-DEV] Re: cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Chuck Hagenbuch
Quoting Andi Gutmans <[EMAIL PROTECTED]>: OK guys. I'd like to roll so please check this problem and give me an ack if it's OK. I believe with Ilia's correction it should be fine now. -chuck -- "Regard my poor demoralized mule!" - Juan Valdez -- PHP Internals - PHP Runtime Development Mailing List

[PHP-DEV] php 4.4 BC break

2005-07-12 Thread Chuck Hagenbuch
Relax, I'm not debating the decision. Just: PLEASE can someone put a big fat warning on the php 4.4 announcement on www.php.net that it breaks existing code? I already have people upgrading to it and wondering why they get tons of warnings now. We're fixing them as quick as we can, but honest

Re: [PHP-DEV] php 4.4 BC break

2005-07-12 Thread Chuck Hagenbuch
Quoting Ilia Alshanetsky <[EMAIL PROTECTED]>: In this case the "facility" was implementing, poorly might I add a handler for a clearly incorrect behavior. Removing it was not only appropriate but necessary to encourage proper code being written. I know that other people have other points of v

Re: [PHP-DEV] Summer of Code Proposal

2006-05-05 Thread Chuck Hagenbuch
Quoting Markus Fischer <[EMAIL PROTECTED]>: Just to support your proposal: yes. Even as a long term PHP user I found exactly this problem some months ago. Since I'm familiar with the PHP source and usually have a checkout around somewhere I can quickly check functions and I was lazy not reportin

Re: [PHP-DEV] namespace examples (solving name resolution order issues)

2008-09-08 Thread Chuck Hagenbuch
Quoting Greg Beaver <[EMAIL PROTECTED]>: Part 3: judgment of value Current approach: advantages: 1) internal classes resolve very fast disadvantages: 1) potential unexpected name resolution to internal class when namespaced classname exists New approach: advantages: 1) code runs the same regar

[PHP-DEV] Fwd: [PATCH] proto fix php_imap.c

2003-11-13 Thread Chuck Hagenbuch
I'm not sure which branch, if any, this should be committed to... - Forwarded message from [EMAIL PROTECTED] - Date: Thu, 13 Nov 2003 18:08:58 +0100 From: Friedhelm Betz <[EMAIL PROTECTED]> Reply-To: Friedhelm Betz <[EMAIL PROTECTED]> Subject: [PATCH] proto fix php_imap.c To

Re: [PHP-DEV] is get_class() case-sensitive now?

2004-01-14 Thread Chuck Hagenbuch
> > I just tried a test parse of phpDocumentor CVS using a fresh compile of > > HEAD on windows xp. It went bananas with warnings and a fatal error. > > Tracking down the error turned up get_class() returning "parserDesc" > > instead of "parserdesc", which ruins every time I test whether > > get_c

Re: [PHP-DEV] Studlycaps and MySQLi

2004-03-27 Thread Chuck Hagenbuch
Quoting Stefan Walk <[EMAIL PROTECTED]>: As far as i can see, that is not neccessary. PEAR naming and PHP naming would only conflict if a PEAR class extends a PHP class. And i fail to see cases where that would happen. That doesn't mean it's not going to happen. Try to be a little forward-thinkin