RE: [PHP-DEV] Missing __toString() part

2006-06-05 Thread Soenke Ruempler
Greg Beaver wrote on Monday, June 05, 2006 11:06 PM: > You miss the point. The warning that is helpful in debugging, it has > nothing to do with designing things to break, it has to do with > unintentional bugs. If in 1 case of 1000 in a loop, there is > an object > in

Re: [PHP-DEV] Missing __toString() part

2006-06-05 Thread Greg Beaver
You miss the point. The warning that is helpful in debugging, it has nothing to do with designing things to break, it has to do with unintentional bugs. If in 1 case of 1000 in a loop, there is an object instead of a string used as a key due to a bug (one example: this can easily happen if you fo

Re: [PHP-DEV] Missing __toString() part

2006-06-05 Thread Jasper Bryant-Greene
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 All I've got to say on the matter is that if anyone is relying on that kind of behaviour for something serious, then their code deserves to break. Jasper Richard Lynch wrote: > That *IS* a current behaviour. > > Returns a warning and leaves the

Re: [PHP-DEV] Missing __toString() part

2006-06-05 Thread Richard Lynch
That *IS* a current behaviour. Returns a warning and leaves the array un-modified. On Sun, June 4, 2006 10:59 pm, Robert Amos wrote: > As far as I can see, and I'm sure someone will be kind enough to > correct me > if I'm wrong, but there is no current behaviour for it, it returns a > warning.

Re: [PHP-DEV] Missing __toString() part

2006-06-05 Thread Evert Pot
Any chance this could be done in the form of an interface, instead of a magic function? Evert Dmitry Stogov wrote: We probably should support this, but not only for __toString(). Objects may also have internal get() (not __get()) and cast() handlers that should be supported too. Also usage of

RE: [PHP-DEV] Missing __toString() part

2006-06-05 Thread Ford, Mike
On 04 June 2006 17:18, Rasmus Lerdorf wrote: > I think if we implement a way to get a hash from an object, > or at least > a unique identifier that can be used as a hash, then it should be > implicit just like other things are implicitly converted when the > context is clear. Of course, you shoul

RE: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Dmitry Stogov
We probably should support this, but not only for __toString(). Objects may also have internal get() (not __get()) and cast() handlers that should be supported too. Also usage of cast() in context of array offset don't say what do we like "int" or "string". Thanks. Dmitry. > -Original Messa

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Sebastian Bergmann
Rasmus Lerdorf wrote: > I think if we are going to add a toHash thing, it should trigger when > the object is used in a hash context, just like toString triggers when > it is used in a string context. This makes sense to me, too. -- Sebastian Bergmann http://www.sebastian-b

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Sebastian Bergmann
Marcus Boerger wrote: > the attached patch closes one more __toString() part. It allows > to use objects that define __toString as indexes to arrays. What do > you guys think about this, should we add it or stay with the old > behavior that didn't allow objects as indexes at all. +1 -- Sebastia

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Robert Amos
As far as I can see, and I'm sure someone will be kind enough to correct me if I'm wrong, but there is no current behaviour for it, it returns a warning. $a = new stdClass; $b[$a] = 0; Warning: Illegal offset type in t3.php on line 2 And results in an empty array (in this case) so it does nothi

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Richard Lynch
On Sat, June 3, 2006 6:42 am, Marcus Boerger wrote: > the attached patch closes one more __toString() part. It allows > to use objects that define __toString as indexes to arrays. What do > you guys think about this, should we add it or stay with the old > behavior that didn't allow objects as in

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Robert Cummings
On Sun, 2006-06-04 at 20:49, Gwynne wrote: > On Jun 4, 2006, at 8:33 PM, Michael Gall wrote: > >> For example, for an eBay Item object, my __toString() returns the > >> Title, but that's not unique, so my __toHash() returns the numeric > >> ID, > >> which is. > > While I wouldn't be surprised if

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andi Gutmans
Need to think about that but I remembered after I sent my email that I was wrong about something like "num:num" (e.g. "3:4") requiring to start with a letter in order not to be auto-converted to a numbered index. The reason for the confusion is the behavior of strtol() in: print "3:4" + 1; Whi

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Gwynne
On Jun 4, 2006, at 8:33 PM, Michael Gall wrote: For example, for an eBay Item object, my __toString() returns the Title, but that's not unique, so my __toHash() returns the numeric ID, which is. While I wouldn't be surprised if you completely ignore my opinion, however I think the __toHash i

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Michael Gall
On 6/5/06, Adam Maccabee Trachtenberg <[EMAIL PROTECTED]> wrote: For example, for an eBay Item object, my __toString() returns the Title, but that's not unique, so my __toHash() returns the numeric ID, which is. While I wouldn't be surprised if you completely ignore my opinion, however I thi

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Adam Maccabee Trachtenberg
On Sun, 4 Jun 2006, Andrei Zmievski wrote: > I am sorry if I missed the whole thread. I think that using the > result of __toString() for indexing objects is a bad idea. If we want > to allow this behavior (which is actually useful in some situations), > I'd rather we had a __hash() method or some

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andrei Zmievski
I am sorry if I missed the whole thread. I think that using the result of __toString() for indexing objects is a bad idea. If we want to allow this behavior (which is actually useful in some situations), I'd rather we had a __hash() method or something similar to what Python does. The strin

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marian Kostadinov
There will be a BC problem with classes implementing ArrayAccess where the array key is passed to offsetXXX methods as it is. And there we have objects also allowed as parameters. 2006/6/3, Marcus Boerger <[EMAIL PROTECTED]>: Hello guys, the attached patch closes one more __toString() part.

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Rasmus Lerdorf
Andi Gutmans wrote: Again, I don't think we should have a hash but a unique id which can be used as an array key and in other things. Difference. Hash implies that it's not unique, I'm talking about unique. So yes, I'd take the starting point of Marcus' proposal but: a) Make the value start wit

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Stanislav, ok, that was good explanation, thanks. best regards marcus Sunday, June 4, 2006, 6:02:33 PM, you wrote: MB>>>typedef struct _zend_object_value { MB>>>zend_object_handle handle; MB>>>zend_object_handlers *handlers; MB>>>} zend_object_value; MB>>> MB>>>And would

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andi Gutmans
At 09:05 AM 6/4/2006, Derick Rethans wrote: On Sun, 4 Jun 2006, Andi Gutmans wrote: > Again, I don't think we should have a hash but a unique id which can be used > as an array key and in other things. Difference. Hash implies that it's not > unique, I'm talking about unique. Instead of all t

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Derick Rethans
On Sun, 4 Jun 2006, Andi Gutmans wrote: > Again, I don't think we should have a hash but a unique id which can be used > as an array key and in other things. Difference. Hash implies that it's not > unique, I'm talking about unique. Instead of all those hacky ways to come up with IDs, why don't s

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andi Gutmans
Again, I don't think we should have a hash but a unique id which can be used as an array key and in other things. Difference. Hash implies that it's not unique, I'm talking about unique. So yes, I'd take the starting point of Marcus' proposal but: a) Make the value start with a letter so that th

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Stanislav Malyshev
MB>>typedef struct _zend_object_value { MB>>zend_object_handle handle; MB>>zend_object_handlers *handlers; MB>>} zend_object_value; MB>> MB>>And wouldn't it be faster to drop both handlers from the table and MB>>instead have zend_object_value have a pointer to zend_class_entry MB>>a

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Stanislav, do you remember any reason why we have the current layout with the zval pointing to a handler and that having a function which returns a pointer to the class_entry as well as a function that returns the name? struct _zend_object_handlers { [...] zend_object_get_class_en

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Stanislav Malyshev
AG>>We should probably make this a requirement and I don't know of one AG>>today that doesn't have an associated class name. I believe some parts AG>>of PHP might blow up if this isn't supported. There are parts that can blow up if get_class_name is NULL or returns NULL (though good practice wo

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Derick Rethans
On Sun, 4 Jun 2006, Andi Gutmans wrote: > Yes, I realize that but it doesn't happen today and I don't think we couldn't > make this a rule (requiring extensions to have unique id's per classes). In > any case, we can always make it the following string: > "id=#unique id" And that is exactly what

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Andi, you don't read my proposals, do you? If you read them you will find that i actually proposed to add a function that uses exactly what you just wrote here. best regards marcus Sunday, June 4, 2006, 5:35:25 PM, you wrote: > Yes, I realize that but it doesn't happen today and I don't

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andi Gutmans
At 08:22 AM 6/4/2006, Stanislav Malyshev wrote: MB>> the classname doesn't help, it is the handler that you need. In MB>>theory you can have two objects with the same id and classname but not MB>>with the same id and handler table. Yes, theoretically you could have two modules returning same cl

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andi Gutmans
Yes, I realize that but it doesn't happen today and I don't think we couldn't make this a rule (requiring extensions to have unique id's per classes). In any case, we can always make it the following string: "id=#unique id" Andi At 08:18 AM 6/4/2006, Marcus Boerger wrote: Hello Andi, the c

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Stanislav Malyshev
MB>> the classname doesn't help, it is the handler that you need. In MB>>theory you can have two objects with the same id and classname but not MB>>with the same id and handler table. Yes, theoretically you could have two modules returning same class names for their objects, though it would be

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Andi, the classname doesn't help, it is the handler that you need. In theory you can have two objects with the same id and classname but not with the same id and handler table. best regards marcus Sunday, June 4, 2006, 5:14:46 PM, you wrote: > At 08:08 AM 6/4/2006, Marcus Boerger wrote:

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andi Gutmans
At 08:08 AM 6/4/2006, Marcus Boerger wrote: Hello Andi, it was your own argument that the id itself is not unique when some time ago somebody wanted to have access to that id from userland. And it is also the reason for SplObjectStorage the way it is today. The object id itself is not unique

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Andi, it was your own argument that the id itself is not unique when some time ago somebody wanted to have access to that id from userland. And it is also the reason for SplObjectStorage the way it is today. By 'it hash' nothing to do with hash' i mean that the classname does not belong i

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andi Gutmans
What extensions today have different objects with the same object ids (inside a certain class)? What do you mean it has nothing to do with hash? Don't understand what you mean. At 07:56 AM 6/4/2006, Marcus Boerger wrote: Hello Andi, the classname has not make the id unique. In fact it has

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Andi, the classname has not make the id unique. In fact it has nothing to do with a hash. best regards marcus Sunday, June 4, 2006, 4:26:13 PM, you wrote: > I would suggest : > a) Make sure $arr[(string)$obj] works (I see no reason for it not to). > b) Look into how to support a uniqu

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Ilia Alshanetsky
On 4-Jun-06, at 10:26 AM, Andi Gutmans wrote: I would suggest : a) Make sure $arr[(string)$obj] works (I see no reason for it not to). It already does, nothing needs to be changed or added. Ilia -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Andi Gutmans
I would suggest : a) Make sure $arr[(string)$obj] works (I see no reason for it not to). b) Look into how to support a unique identifier (-1 on a hash value). Two main questions are how this thing looks like, and whether it's explicit (you need to call some function/method to get it) or implici

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Pierre, Sunday, June 4, 2006, 2:05:52 PM, you wrote: > On 6/4/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: >> Adding a function hash_from_object() or spl_hash_from object() to ease >> > the generations of hashes is indeed a good idea. There is no impact in >> > the objects managements an

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Pierre
On 6/4/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: > Adding a function hash_from_object() or spl_hash_from object() to ease > the generations of hashes is indeed a good idea. There is no impact in > the objects managements and people are free to use it or not (no magic > default behaviors). H

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Pierre, Sunday, June 4, 2006, 1:52:41 PM, you wrote: > Hello, >> Hello Rasmus, Andi, >> [EMAIL PROTECTED] /usr/src/PHP_5_2 $ php -r 'var_dump(spl_object_hash(new >> stdClass));' string(32) "0bab1548e3b42acbcf1170617b5432ae" >> >> For PHP 5.2 we could think about adding a hash handler to

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Pierre
Hello, > Hello Rasmus, Andi, > [EMAIL PROTECTED] /usr/src/PHP_5_2 $ php -r 'var_dump(spl_object_hash(new > stdClass));' string(32) "0bab1548e3b42acbcf1170617b5432ae" > > For PHP 5.2 we could think about adding a hash handler to the object > handler table and provide the above as default implemen

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Marcus Boerger
Hello Rasmus, Andi, first to Andi, there is no BC involved beside the fact that this would allow objects being used in arrays which wasn't possible before. Now a hashing value can easily be generated: char * hash; int len = spprintf(&hash,0,"%p:%d",Z_OBJ_HT_P(zobj),Z_OBJ_HANDLE_P(zobj)); That s

Re: [PHP-DEV] Missing __toString() part

2006-06-04 Thread Zeev Suraski
Whichever way we go, the key would have to be either an integer or a string (since that's what array indices can be), and going with an integer here sounds like a really bad idea (chances of it colliding with numeric indices are reasonably high on a 32-bit system). So if we go with (a), it wou

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Pierre
On Sat, 03 Jun 2006 18:50:09 -0700 [EMAIL PROTECTED] (Rasmus Lerdorf) wrote: > This works today and basically gives you the same thing. The only > thing it doesn't do is separate an array index context from an output > context allowing you do different things in the two cases. > > I think if we

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Rasmus Lerdorf
Alan Knowles wrote: $x = new Obj; $y[$x]= 123; That behaviour is going to be fun to document, and for people unfamilar with it to find in the manual -> php.net/array -> go to array syntax page -> read down to find about objects as keys -> go to __toHash() page... ..whereas... $x = new Obj;

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Alan Knowles
$x = new Obj; $y[$x]= 123; That behaviour is going to be fun to document, and for people unfamilar with it to find in the manual -> php.net/array -> go to array syntax page -> read down to find about objects as keys -> go to __toHash() page... ..whereas... $x = new Obj; $y[$x->toHash()]= 123

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Andi Gutmans
Yep that is also a choice, although it can be advantageous to have an automatic (a) which people just now works, always... I don't think it's a critical problem because as you pointed out people can deal with it, but I think it'd be nice to provide some tools to make life easier. At 06:01 PM

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Pierre
Hi, On 6/4/06, Andi Gutmans <[EMAIL PROTECTED]> wrote: > Generally I think it's a good thing to allow to use objects as array > indexes. There are really two ways of doing it: > a) Try and find a way to create unique ideas. > b) Support __toString() and leave it up to the author. I see a third ch

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Andi Gutmans
Generally I think it's a good thing to allow to use objects as array indexes. There are really two ways of doing it: a) Try and find a way to create unique ideas. b) Support __toString() and leave it up to the author. I have a bit of a hard time finding a solution to (a) unless the unique id is

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread bertrand Gugger
Gwynne wrote: > no attempt would/should be made to calculate a hash based on anything other than what the object is willing to call itself. +1 here oo people have a name for that. and implement what's needed. I'm surely out of talk , but please keep indexes scalar. The toString way is anyway

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Gwynne
On Jun 3, 2006, at 6:12 PM, Jasper Bryant-Greene wrote: I would imagine that __hash() or whatever it is called would be defined on all objects and implemented internally in PHP, and would simply generate some internal hash that is unique for all objects. That might work for initial testing, b

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Jasper Bryant-Greene
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Gwynne wrote: > I'm new to this list, so I apologize if I'm out of line in commenting > here, but it's my opinion that the advantages offered by a __hash() > magic function would outweigh the inevitable complexity and issues > involved. I imagine

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Gwynne
On Jun 3, 2006, at 1:13 PM, Rasmus Lerdorf wrote: RL>>I don't understand why using the object as an index would trigger a RL>>__toString() call. PHP's array indices are not defined to be strings, RL>>so I don't see this as being a string context use and thus RL>>__toString() shouldn't be c

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Rasmus Lerdorf
Stanislav Malyshev wrote: RL>>I don't understand why using the object as an index would trigger a RL>>__toString() call. PHP's array indices are not defined to be strings, RL>>so I don't see this as being a string context use and thus RL>>__toString() shouldn't be called. If so, what should

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Rasmus Lerdorf
Right, just let me clarify. My point here was that if we are going to make a change here, we should do it correctly and come up with a way to create a unique hash of the object so it really can be used as an array index. Magically calling __toString() in a case where we don't have an explicit

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Stanislav Malyshev
RL>>I don't understand why using the object as an index would trigger a RL>>__toString() call. PHP's array indices are not defined to be strings, RL>>so I don't see this as being a string context use and thus RL>>__toString() shouldn't be called. If so, what should be the actual key in the has

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Marcus Boerger
Hello Rasmus, though you are probably right here your idea brought to it's full extend will bring a major BC break. Just consider we had both key and value as a zval then the current behavior would change for quite a lot of situations including not only objects and resources but also booleans, f

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Marcus Boerger
Hello Andrew, Saturday, June 3, 2006, 4:36:39 PM, you wrote: > On Sat, Jun 03, 2006 at 01:42:12PM +0200, Marcus Boerger wrote: >> Hello guys, >> >> the attached patch closes one more __toString() part. It allows >> to use objects that define __toString as indexes to arrays. What do >> you guys

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Rasmus Lerdorf
I don't understand why using the object as an index would trigger a __toString() call. PHP's array indices are not defined to be strings, so I don't see this as being a string context use and thus __toString() shouldn't be called. I also don't see why we need to make a distinction between the

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Ilia Alshanetsky
I think this is a potentially missing bit of functionality we definitely need to consider including. There is really no technical reason why $foo[new ToStringObject] = "bar"; cannot work or a reason why it shouldn't as far as functionality goes. Ilia Alshanetsky On 3-Jun-06, at 7:42 AM

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Andrew Yochum
On Sat, Jun 03, 2006 at 01:42:12PM +0200, Marcus Boerger wrote: > Hello guys, > > the attached patch closes one more __toString() part. It allows > to use objects that define __toString as indexes to arrays. What do > you guys think about this, should we add it or stay with the old > behavior th

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Derick Rethans
On Sat, 3 Jun 2006, Marcus Boerger wrote: > Hello Robert, > > well lazy is a good point here but __toString is all about lazyness. > Then again as said you might want to have objects naturally convert > to strings whereever possible. Generally when providing a __toString > implementation you sa

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Pierre
On 6/3/06, Robert Amos <[EMAIL PROTECTED]> wrote: Thats fair, as long as it doesn't result in any unwanted behaviour then I'm +1. Good luck ;-) --Pierre -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Robert Amos
Thats fair, as long as it doesn't result in any unwanted behaviour then I'm +1. -Rob On 6/3/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: Hello Robert, well lazy is a good point here but __toString is all about lazyness. Then again as said you might want to have objects naturally convert to

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Marcus Boerger
Hello Robert, well lazy is a good point here but __toString is all about lazyness. Then again as said you might want to have objects naturally convert to strings whereever possible. Generally when providing a __toString implementation you say that you want this. And then you might as well expect

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Robert Amos
Hi, Is it really worth enabling a whole new area where problems could occur just for this? Can you provide an example of where it might actually be considered useful and not just being lazy? -Rob On 6/3/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: Hello Pierre, ever thought that we use tes

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Pierre
On 6/3/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: Hello Pierre, ever thought that we use tests to check special behavior and that those snippets have little to do with real applications? Obviously not. The idea behind is that for instance you might use an array as a translation and use an o

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Michael Walter
Yes definitely, that functionality would be useful. Regards, Michael On 6/3/06, Pierre <[EMAIL PROTECTED]> wrote: Hi, On 6/3/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: > Hello guys, > > the attached patch closes one more __toString() part. It allows > to use objects that define __toString

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Marcus Boerger
Hello Pierre, ever thought that we use tests to check special behavior and that those snippets have little to do with real applications? Obviously not. The idea behind is that for instance you might use an array as a translation and use an object to *calculate* the index. Saturday, June 3, 2006

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Pierre
Hi, On 6/3/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: Hello guys, the attached patch closes one more __toString() part. It allows to use objects that define __toString as indexes to arrays. What do you guys think about this, should we add it or stay with the old behavior that didn't allow