Re: [PHP-DEV] Simple Namespace Proposal

2007-07-14 Thread Hans Lellelid
As someone that has long clamoured for namespaces in PHP, I have to say that this proposal by Dmitry is exactly what I others have been hoping for in PHP. Thanks, Dmitry, for creating this patch. I'm sure there are going to be some peculiarities that need to be sorted out, but I can't wait

[PHP-DEV] DateTime object equality

2007-03-04 Thread Hans Lellelid
Hi all, DateTime equality (not identity) appears to be broken. I've created a ticket for this issue (http://bugs.php.net/bug.php?id=40691), which keeps getting marked as bogus by Ilia. This may be a more appropriate issue to raise on list, as I seem to be having both a very hard time making my

[PHP-DEV] DateTime object equality

2007-03-04 Thread Hans Lellelid
Hi all, DateTime equality (not identity) appears to be broken. I've created a ticket for this issue (http://bugs.php.net/bug.php?id=40691), which keeps getting marked as bogus by Ilia. This may be a more appropriate issue to raise on list, as I seem to be having both a very hard time making my

Re: [PHP-DEV] Namespaces in PHP 6 - ++$take

2006-11-10 Thread Hans Lellelid
I think there is far more demand for a fast stable PHP then for syntatic sugar features which seem extremely useful, but in the end prove to carry too much baggage. Nothing has been proven either way.. at least not publicly.. unless I just missed it. I haven't talked to a single

Re: [PHP-DEV] Namespaces in PHP 6 - ++$take

2006-11-10 Thread Hans Lellelid
Brian Moon wrote: Unfortunately namespaces are not only syntactic sugar, but dire necessity for PHP if it wants to be taken as a serious langauage and defend it's position against other arising 'web scripting' alternatives. It seems the list of things that PHP needs to be taken as a serious

Re: [PHP-DEV] [PATCH] Modifications for ext/session/

2005-04-26 Thread Hans Lellelid
Sascha Schumann wrote: They are not helpful for various reasons. e.g. if you need to ask whether a session was started, your architecture is broken (a central place needs to manage sessions; that single place must know whether a session has been started). I haven't looked in any

Re: [PHP-DEV] [PATCH] Modifications for ext/session/

2005-04-26 Thread Hans Lellelid
Stefan Esser wrote: Hi, I haven't looked in any detail at these functions, but wouldn't you be able to prevent fixation by inquiring whether a particular session was already started? -- rather than PHP's current (IMHO flawed) behavior where a new session is simply started with whatever session

Re: [PHP-DEV] [PATCH] Modifications for ext/session/

2005-04-26 Thread Hans Lellelid
Stefan Esser wrote: Hi, Sorry, perhaps this is just a vocabulary misunderstanding on my part. I thought fixation was explicitly providing the user with a fake but known session id (e.g. '1'), whereas hijacking is taking a valid id from another user. yeah... Well you call it fake session id.

Re: [PHP-DEV] [PATCH] Modifications for ext/session/

2005-04-26 Thread Hans Lellelid
Dan Kalowsky wrote: On Tue, 26 Apr 2005, Hans Lellelid wrote: I see your point, but I would still argue that being able to create an arbitrary, non-server-supplied session id is far more powerful -- primarly because it is not susceptible to session garbage collection on the server (i.e

Re: [PHP-DEV] why does PHP accept [new] session ids from client?

2005-03-31 Thread Hans Lellelid
Hi Zeev, Zeev Suraski wrote: At 19:47 29/03/2005, Hans L wrote: Hi, This may not be the right place for this question, but what I'm looking to understand is the reasoning behind what seems to be the standard session behavior in PHP. And, if it's possible, how to change this behavior (via INI

Re: [PHP-DEV] why does PHP accept [new] session ids from client?

2005-03-31 Thread Hans Lellelid
Hi Chris, Chris Shiflett wrote: M. Sokolewicz wrote: why is it this way should also be posted to the general newsgroup, it barely has anything to do with internals The behavior of the session extension has everything to do with internals. I'm not sure why everyone is sending him to php-general.

Re: [PHP-DEV] is_a() vs. instanceof

2004-08-11 Thread Hans Lellelid
Alan Knowles wrote: I think he's referening to something like this (which is common in pear): $x = $someobj-somemethod(); if ($x instanceOf PEAR_Error) { ... } while that code is redundant in the case of exceptions, it is still a valid situation.. that $x may be a valid return, and

[PHP-DEV] is_a() vs. instanceof

2004-08-10 Thread Hans Lellelid
I like the new $obj instanceof ClassName way of checking class / interface types, but this method does have one major drawback compared to the old is_a() approach: The class must be loaded in order to perform an instanceof check! Apparently is_a() has also been deprecated, so that an

[PHP-DEV] Re: static/object method

2004-06-24 Thread Hans Lellelid
Taco Van Den Broek wrote: Hans Lellelid wrote: static, default behavior, probably accounts for 80% of uses: $c = new Criteria(Author::NAME, Leo); $a = AuthorFinder::find($c); You pass your criteria to your search class as instantiated objects, why don't you pass your parameters/config

[PHP-DEV] static/object method

2004-06-23 Thread Hans Lellelid
Hi all, I have a pattern I'm trying to implement in PHP5 using a class that could be called statically or non-statically. Perhaps pattern gives this too much legitimacy :) I can't figure out how to do this wanted to ask if a) it's possible at all and b) if there's been any solution

[PHP-DEV] Re: static/object method

2004-06-23 Thread Hans Lellelid
Andre Cerqueira wrote: $c = new Criteria(Author::NAME, Leo); $a = AuthorFinder::find($c); instantiated behavior for performing customizations: $c = new Criteria(Author::NAME, Leo); $af = new AuthorFinder(); $af-setLimit(5); $a = $af-find($c); I think it should be constructor's job to

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Hans Lellelid
Hi, Marcus Boerger wrote: Last but not least we know already that a lot of people like to be able to handle both instanceof or null with typehints. But at the moment we have no solution that can go into PHP 5.0. However i am quite sure we will address this for 5.1. I'm glad this issue will be

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Hans Lellelid
Marcus Boerger wrote: Here is a slightly related example from my code [] -- and it would be nice if I could use optional paramters w/ typehints. IMO thats the only valid point you brought up here. Another thing missing is that in derived classes the typehints should be able to accept

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Hans Lellelid
Hi Marcus, Marcus Boerger wrote: Hello Hans, Friday, June 18, 2004, 9:15:47 PM, you wrote: Of course, namespaces are more important than anything ;) hehe, could you live with packages? Probably! yeah :) -- what's the difference? Are namespaces more like what's implement in C#/.NET (i.e. no

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Hans Lellelid
Andrei Zmievski wrote: abstract class BasePeer { // ... public static function doDelete(Criteria $criteria, Connection $con) { // ... } } class AuthorPeer extends BasePeer { public static function doDelete(Criteria $criteria, $con = null) { if ($con === null) { $con =

[PHP-DEV] Re: 'false' - boolean interpratation

2004-06-08 Thread Hans Lellelid
Robert Janeczek wrote: is there any way that string 'false' (and its variations with capital letters) could be interpeted as boolean of value false? i have xml configuration file that has some switches (true/false) in it. when i use this values in functions that require booleans i get true every

[PHP-DEV] PHP5 rocks!

2004-06-07 Thread Hans Lellelid
Hi guys, I just had to take a moment to let you all know just how cool this PHP5 thing is. I know that I've been kinda vocal (and perhaps out of place) in the past about some of the behavior of OO stuff like interfaces, and sure disappointed when __toString() became less magical, etc. Those

[PHP-DEV] Re: Use of 'self' in static function in subclass

2004-06-01 Thread Hans Lellelid
Bert Slagter wrote: Hi All, I have a class and a subclass, both with a static method: ?php class Foo { static function Bar() { self::Baz(); } } class Foo2 extends Foo { static function Baz() { echo 'Baz'; } } Foo2::Bar(); ? In this case I expect to find

Re: [PHP-DEV] Use of 'self' in static function in subclass

2004-06-01 Thread Hans Lellelid
Ferdinand Beyer wrote: On 1 Jun 2004 at 15:21, Stephan Schmidt wrote: Furthermore this renders the template-method pattern quite useless, so IMHO it should be changed. He should define an abstract method Foo::Baz() here. Yes, I agree that design-wise that would be better -- but it will still

Re: [PHP-DEV] Use of 'self' in static function in subclass

2004-06-01 Thread Hans Lellelid
Ferdinand Beyer wrote: On 1 Jun 2004 at 21:13, Timm Friebe wrote: Yes: self is bound at compiletime. It would need to be changed to evaluation at runtime und would be far more useful then. [...] I wouldn't mind chaning self in the first place, though. I prefer your solution to evaluate self at

Re: [PHP-DEV] [RFC] Type hints

2004-05-10 Thread Hans Lellelid
Andi Gutmans wrote: As no good syntax has been found for the less common case of allowing NULL's, I think the best solution for now is not to allow null in the regular type hint syntax, and have people who want to allow NULL's not use type hints at all (in any case, they need to manually check

[PHP-DEV] == object comparison bug?

2004-04-28 Thread Hans Lellelid
I'm using PHP5.0.0RC2. I saw that there was a similar question posted, but apparently that issue had already been fixed. ---code class File { public $var; function __construct($val) { $this-var = $val; } } $t1 = new

[PHP-DEV] Re: Patch to minimize session fixation (continued)

2004-04-07 Thread Hans Lellelid
I also would add that from experience using IP addresses to validate sessions does not work for any internet application. It is not generic enough to be implemented in world-wide application, but it can be useuful for intranet or extranets. That's to say cases when you know the infrastructure

Re: [PHP-DEV] Studlycaps and MySQLi

2004-03-23 Thread Hans Lellelid
Marcus Boerger wrote: I already changed SQLite because as far as i know there were only two extensions left which didn't follow studlyCaps convention which we agreed upon twice so far - even though ppl pretend we hadn't. The only other extension i spotted so far not following studlyCaps is ming -

Re: [PHP-DEV] RC1 of RC1

2004-03-17 Thread Hans Lellelid
Hi - Andi Gutmans wrote: Only if you use E_STRICT. There was a long discussion about this on internals@ a few weeks ago. At 11:57 AM 3/17/2004 +0100, Clemens Gutweiler wrote: ?php interface person { function wakeup( $day, $time ); } class hugo

Re: [PHP-DEV] RC1 of RC1

2004-03-17 Thread Hans Lellelid
Andi Gutmans wrote: Nope. The final decision was to only check this during E_STRICT because there's no reason why inheritance should be different from implementation. People here felt that due to PHP not supporting function overloading we should not be very strict, and therefore, only give

Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Hans Lellelid
Hi Andi, Quick question - Andi Gutmans wrote: Marcus and rest, Zeev and I took a long look at the whole __toString() issue. There is a problem today that make_printabl_zval() is being called in many places, some of which can't cope with a user-land __toString() being called. In order to

Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Hans Lellelid
Hi - Andi Gutmans wrote: Just to clarify, this is only for internal classes like Exception, right? Userland __toString() will continue to be invoked when an explicit (string) cast (or concat, etc.) is used, correct? Wrong. The only time userland __toString() will be invoked will be in

[PHP-DEV] class constants in RC1

2004-03-15 Thread Hans Lellelid
I notice that in the new RC1, the following reference to class constants is no longer possible: class MyClass { const MY_CONST = 1; function __construct() { echo MY_CONST; } } You must now use self::MY_CONST to reference the class constant. While I

[PHP-DEV] Re: No static method callbacks anmore?

2004-03-15 Thread Hans Lellelid
I was just about to post the same bug ... Except that I couldn't quite build a reproducing testcase. I get exactly the same message in my code, but when I created a small static class to reproduce the problem it seems to work fine ... (static or non-static or mixture) Hans Jan Schneider

[PHP-DEV] obj == null check generates E_NOTICE

2004-03-15 Thread Hans Lellelid
obj == null checks now trigger E_NOTICE class Foo { } $t = new Foo(); if ($t == null) { } Notice - Object of class Foo could not be converted to boolean Changing the comparison to $t === null makes the notice go away. Is this intended? If not I can post it as a bug report. Thanks, Hans --

[PHP-DEV] reproduce script (Re: [PHP-DEV] No static method callbacks anmore?)

2004-03-15 Thread Hans Lellelid
Here's a script to reproduce the problem w/ static callbacks. The problem only seems to happen when the function calling the static function using preg_replace_callback() is not declared 'static' itself, but is accessed as a static function. Also, this only happens when being called from

Re: [PHP-DEV] Iterator Class/foreach Logic Flaw?

2004-03-01 Thread Hans Lellelid
Hi Marcus, Andrei Zmievski wrote: On Thu, 26 Feb 2004, Philip Fletcher wrote: Looking at the documentation, the comments and method name (for hasMore()) do not have the same meaning - the comment is saying 'does the current element exist?' and the method name says 'are there any more elements?'.

Re: [PHP-DEV] Iterator Class/foreach Logic Flaw?

2004-03-01 Thread Hans Lellelid
Hi - Andi Gutmans wrote: Well we don't have very much time anymore because I want to roll RC1 ASAP (assuming that we get a couple of bugs fixed which need fixing). Personally I'm fine with either of these (I don't mind hasMore()) but a decision has to be reached quickly. From discussing with

Re: [PHP-DEV] Declaration of Bar::__construct() must be

2004-02-27 Thread Hans Lellelid
Hi - Andi Gutmans wrote: The question is if we should ignore constructors from this check. I think we should but one person here thought we shouldn't. I think constructors should be ignored. Is everyone OK with peforming this check for abstract classes and interfaces? Or do you think it should

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-26 Thread Hans Lellelid
Ferdinand Beyer wrote: IMO we are trying to force a strict programming here that is incompatible with PHP's loose character. Yeah, I absolutely agree with that. The more I think about it the more it also seems like this change is going to break a *lot* of PHP code out there. Especially the

Re: [PHP-DEV] Declaration of Bar::__construct() must be

2004-02-26 Thread Hans Lellelid
Hi Zeev - Thanks for the response. Zeev Suraski wrote: If you take into account that [a] in PHP, you cannot have more than one signature for a method in a given class, and you take into account the fact that [b] your overriding method must be able to satisfy the same interface as the method

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-25 Thread Hans Lellelid
Timm Friebe wrote: On Wed, 2004-02-25 at 23:44, Marcus Boerger wrote: Hello Timm, i had the same expirience today too. And also for me it makes not much sense. The constructor shouldn't check inheritance rules. Neither should other methods follow this. What if I want to add a non-default

[PHP-DEV] Re: segfault in shutdown sequence

2004-02-24 Thread Hans Lellelid
to be in shutdown sequence but beyond that I'm not sure -- Reflection_API, XML (expat) ... ? Not using destructors... Thanks- Hans Hans Lellelid wrote: I'm getting a segfault at the end of (successful) script execution. Appears to be an issue in the shutdown sequence; I'm unsure how to report this bug, since

Re: [PHP-DEV] Re: Static weirdness..

2004-02-19 Thread Hans Lellelid
Timm Friebe wrote: On Wed, 2004-02-18 at 18:40, Hans Lellelid wrote: foreach($entities as $ent) { $peer = $ent-getPeer(); // e.g. might be BookPeer $peer-doSelect(new Criteria()); //static: BookPeer::doSelect() } $m= new Reflection_Method($ent-getPeer(), 'doSelect'); $m-invoke

Re: [PHP-DEV] Re: Static weirdness..

2004-02-18 Thread Hans Lellelid
Hi - Pierre-Alain Joye wrote: On Wed, 18 Feb 2004 12:23:04 -0500 John Coggeshall [EMAIL PROTECTED] wrote: class foo { static function bar() { } } $a = new foo(); $a-bar(); /* Unacceptable and contradictory to the concept of static */ foo::bar(); /* Acceptable */ I have the same

Re: [PHP-DEV] more on interface inheritance issues

2004-02-17 Thread Hans Lellelid
Andi Gutmans wrote: It depends what you call different signature. If you are talking about default arguments, we should consider allowing those as they don't change the isA relationship. However, if you want us to allow inheriting interfaces which truly differ in function prototypes than

Re: [PHP-DEV] more on interface inheritance issues

2004-02-17 Thread Hans Lellelid
Hi - Cristiano Duarte wrote: On Tue, 17 Feb 2004 15:34:11 +, Stephane Drouard wrote: Hans, In PHP you are not allowed to explicit overload methods. Ex: class A { function x($a1) {} function x($a1, $a2) {} } The function x is already defined and explicit overloading is not

Re: [PHP-DEV] more on interface inheritance issues

2004-02-17 Thread Hans Lellelid
Hi- Cristiano Duarte wrote: I still think that interfaces should follow the same behavior as classes (i.e. if you can override in classes you can override in interfaces), but I understand that academically this is wrong. Of course overriding is wrong period, but it's the route you have to take

Re: [PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2

2004-02-16 Thread Hans Lellelid
Andi Gutmans wrote: Hey, Marcus didn't mean it adds complexity to the code but to PHP. It's obviously quite easy to implement this interface; implementation was never a problem. I don't really care too much if we have such an interface or not, although I do think that it just makes things

Re: [PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2

2004-02-16 Thread Hans Lellelid
Andi Gutmans wrote: Hey, Marcus didn't mean it adds complexity to the code but to PHP. It's obviously quite easy to implement this interface; implementation was never a problem. I don't really care too much if we have such an interface or not, although I do think that it just makes things

Re: [PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2

2004-02-16 Thread Hans Lellelid
Hi - Ard Biesheuvel wrote: Hans Lellelid wrote: Personally as PHP developer (as opposed to internals developer) I am not in favor of having an interface, because I want to know that try { // ... } catch (Exception $e) { // ... } will catch *all* exceptions thrown by any libraries I choose

Re: [PHP-DEV] extending interfaces - fringe behavior

2004-02-16 Thread Hans Lellelid
Hi - Zeev Suraski wrote: At 07:55 16/02/2004, Hans Lellelid wrote: I have a need in a current application to extend interfaces and possibly re-define (change signature) some of the inherited methods in the child interface. ... You're not supposed to change the signature when you're extending

[PHP-DEV] more on interface inheritance issues

2004-02-16 Thread Hans Lellelid
Hi - This issue of inheritance interfaces persists to give me problems... Perhaps I'm going about this wrong for PHP. Zeev Suraski wrote: You're not supposed to change the signature when you're extending/implementing interfaces. I'll try to see if it's feasible to improve the checks so

Re: [PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2

2004-02-16 Thread Hans Lellelid
Hi Adam - Adam Bregenzer wrote: My biggest motivation for not having an exception class was to prevent people from having a catch all with exceptions. Personally, I think that attitude is what has caused an over use of exceptions (making every function throw Exception so as to not have to deal

Re: [PHP-DEV] interfaces extending multiple interfaces

2004-02-15 Thread Hans Lellelid
Hi - Sebastian Bergmann wrote: Andi Gutmans wrote: Zeev is planning on fixing this. Cool. Interfaces should be allowed to extend other interfaces but not to implement them. interface Bar extends Foo {} works already (at least last time I checked). What I need (and meant) is

[PHP-DEV] segfault in shutdown sequence

2004-02-15 Thread Hans Lellelid
I'm getting a segfault at the end of (successful) script execution. Appears to be an issue in the shutdown sequence; I'm unsure how to report this bug, since providing duplicating code is not possible. The segfault is happening at the end of a Phing (http://phing.info) build process, which

Re: [PHP-DEV] interfaces extending multiple interfaces

2004-02-15 Thread Hans Lellelid
Sebastian Bergmann wrote: Hans Lellelid wrote: I thought this was going to be fixed for beta4/RC1, but still seems not to be. Works for me: Apologies! -- yes, it does work. I was still doing the old Foo implements Foo, Bar which used to work (but never should have). Thanks- Hans -- PHP

[PHP-DEV] interfaces extending multiple interfaces

2004-01-16 Thread Hans Lellelid
Is there any way to have an _interface_ implement or extend multiple interfaces? This was working as of PHP5b3, but seems to work no longer as of latest snapshot I downloaded. The only way to do it before was to have an interface implement other interfaces: interface ExtendFileSelector

Re: [PHP-DEV] reflection API bug or change?

2003-12-23 Thread Hans Lellelid
On Mon, 2003-12-22 at 16:05, Hans Lellelid wrote: Hi - We're using the Reflection API in a project for which I'm lead developer. Seems to be something changed between beta-2 and beta-3. We're now getting the following exception when calling getClass() on a class hint: [...] Works fine

[PHP-DEV] reflection API bug or change?

2003-12-22 Thread Hans Lellelid
Hi - We're using the Reflection API in a project for which I'm lead developer. Seems to be something changed between beta-2 and beta-3. We're now getting the following exception when calling getClass() on a class hint: exception 'reflection_exception' with message 'Class FileSet does not

[PHP-DEV] CVS Account Request: hlellelid

2003-07-01 Thread Hans Lellelid
Daniel Khan has asked me to help him with DB_NestedSet by maintaining the MDB driver. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php