[PHP-DEV] __toString()

2003-12-14 Thread Sebastian Bergmann
The following code from PHPUnit stopped working after the recent changes to __toString() protected function printDefectTrace(PHPUnit_Framework_TestFailure $defect) { print $defect->thrownException() . "\n"; print PHPUnit_Runner_BaseTestRunner::getFilteredStack(

Re: [PHP-DEV] array_reverse

2003-12-14 Thread Michael Walter
Felipe Lopes wrote: Hi there! What you guys think about make array_reverse() a variable referenced function. I mean something like: function new_array_reverse(&$array){ $array = array_reverse($array); } -1 from me (supposed my vote counts ;), as this works pretty much against functional

Re: [PHP-DEV] __toString()

2003-12-14 Thread Marcus Boerger
Hello Sebastian, Sunday, December 14, 2003, 8:56:15 AM, you wrote: > The following code from PHPUnit stopped working after the recent changes > to __toString() > protected function printDefectTrace(PHPUnit_Framework_TestFailure > $defect) { > print $defect->thrownException

Re: [PHP-DEV] __toString()

2003-12-14 Thread Sebastian Bergmann
Marcus Boerger wrote: > We found out that calling __toString() automatically in any place in > the executor has unsolveable problems right now (ask Andi for details). So if __toString() is no longer automatically called what is its purpose then? I mean, if I have to explicitly call it via -

Re: [PHP-DEV] __toString()

2003-12-14 Thread Derick Rethans
On Sun, 14 Dec 2003, Sebastian Bergmann wrote: > Marcus Boerger wrote: > > We found out that calling __toString() automatically in any place in > > the executor has unsolveable problems right now (ask Andi for details). > > So if __toString() is no longer automatically called what is its > pur

Re: [PHP-DEV] __toString()

2003-12-14 Thread Marcus Boerger
Hello Sebastian, Sunday, December 14, 2003, 1:52:38 PM, you wrote: > Marcus Boerger wrote: >> We found out that calling __toString() automatically in any place in >> the executor has unsolveable problems right now (ask Andi for details). > So if __toString() is no longer automatically called w

Re: [PHP-DEV] __toString()

2003-12-14 Thread Andi Gutmans
It is supported by "print" and for internal extensions such as SimpleXML which require this. Also in Java toString() isn't called automagically in every place so I wouldn't call it useless. Andi At 08:56 AM 12/14/2003 +0100, Sebastian Bergmann wrote: The following code from PHPUnit stopped wo

Re: [PHP-DEV] __toString()

2003-12-14 Thread Sebastian Bergmann
Derick Rethans wrote: > Actually, you should as __ is reserved for magic methods... Until recently __toString() was a magic method. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-

Re: [PHP-DEV] __toString()

2003-12-14 Thread Sebastian Bergmann
Andi Gutmans wrote: > It is supported by "print" and for internal extensions such as > SimpleXML which require this. How is it supported by "print" when print $defect->thrownException() does not work but the object returned from thrownException() has a __toString() method? -- Sebasti

[PHP-DEV] Current HEAD triggers debug assertion on Windows

2003-12-14 Thread Sebastian Bergmann
_free_dbg(void * 0x00da43e0, int 1) line 1001 + 13 bytes free(void * 0x00da43e0) line 956 + 11 bytes cwd_globals_dtor(_virtual_cwd_globals * 0x00da43a8, void * * * 0x00da4268) line 177 + 14 bytes tsrm_shutdown() line 167 + 33 bytes main(int 4, char * * 0x00da3ea8) line 1023 + 8 bytes mainCRTStartup

Re: [PHP-DEV] __toString()

2003-12-14 Thread Cristiano Duarte
Em Sun, 14 Dec 2003 15:41:10 +0100, Sebastian Bergmann escreveu: > Andi Gutmans wrote: >> It is supported by "print" and for internal extensions such as >> SimpleXML which require this. > > How is it supported by "print" when > > print $defect->thrownException() > > does not work but th

Re: [PHP-DEV] Current HEAD triggers debug assertion on Windows

2003-12-14 Thread Marcus Boerger
Hello Sebastian, should be fixed by last commit to TSRM.c Sunday, December 14, 2003, 4:31:39 PM, you wrote: > _free_dbg(void * 0x00da43e0, int 1) line 1001 + 13 bytes > free(void * 0x00da43e0) line 956 + 11 bytes > cwd_globals_dtor(_virtual_cwd_globals * 0x00da43a8, void * * * 0x00da4268) > line

Re: [PHP-DEV] Current HEAD triggers debug assertion on Windows

2003-12-14 Thread Sebastian Bergmann
Marcus Boerger wrote: > should be fixed by last commit to TSRM.c It is, thanks, Sebastian -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/ -- PHP Internals - PHP Runtime

Re: [PHP-DEV] __toString()

2003-12-14 Thread Adam Maccabee Trachtenberg
On Sun, 14 Dec 2003, Sebastian Bergmann wrote: > How is it supported by "print" when > > print $defect->thrownException() > > does not work but the object returned from thrownException() has a > __toString() method? That's part of my problem with __toString, there's a difference between

Re: [PHP-DEV] __toString()

2003-12-14 Thread Jon Parise
On Sun, Dec 14, 2003 at 03:41:10PM +0100, Sebastian Bergmann wrote: > > It is supported by "print" and for internal extensions such as > > SimpleXML which require this. > > How is it supported by "print" when > > print $defect->thrownException() > > does not work but the object returned

[PHP-DEV] Re: [PHP-CVS] cvs: php-src / cvsclean.bat

2003-12-14 Thread Sebastian Bergmann
Jani Taskinen wrote: > Does this has to be in 'root'..? All the other win32 > stuff is in php-src/win32 ?? buildconf.bat is also in 'root'. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwickl

Re: [PHP-DEV] __toString()

2003-12-14 Thread Sebastian Bergmann
Jon Parise wrote: > Hopefully, this still works (don't have a recent PHP5 build to try): > > print (string)$defect->thrownException(); > > The explicit cast also addresses this case: > > print (string)$defect->thrownException() . "\n"; bar; } } $foo = new Foo; print $foo;

Re: [PHP-DEV] __toString()

2003-12-14 Thread Andi Gutmans
At 08:35 PM 12/14/2003 -0500, Jon Parise wrote: On Sun, Dec 14, 2003 at 03:41:10PM +0100, Sebastian Bergmann wrote: > > It is supported by "print" and for internal extensions such as > > SimpleXML which require this. > > How is it supported by "print" when > > print $defect->thrownException(

Re: [PHP-DEV] __toString()

2003-12-14 Thread George Schlossnagle
On Dec 15, 2003, at 1:09 AM, Andi Gutmans wrote: At 08:35 PM 12/14/2003 -0500, Jon Parise wrote: On Sun, Dec 14, 2003 at 03:41:10PM +0100, Sebastian Bergmann wrote: > > It is supported by "print" and for internal extensions such as > > SimpleXML which require this. > > How is it supported by "p

Re: [PHP-DEV] __toString()

2003-12-14 Thread Jon Parise
On Mon, Dec 15, 2003 at 08:09:12AM +0200, Andi Gutmans wrote: > >Hopefully, this still works (don't have a recent PHP5 build to try): > > > >print (string)$defect->thrownException(); > > > >The explicit cast also addresses this case: > > > >print (string)$defect->thrownException() . "\n";

Re: [PHP-DEV] __toString()

2003-12-14 Thread Jon Parise
On Mon, Dec 15, 2003 at 01:32:57AM -0500, George Schlossnagle wrote: > >Nope. How is it different or nicer than doing > >$defect->thrownException()->__toString()? > >It saves you 4 characters? > > If it doesn't do anything 'magical', why bother with the __? If you > always have to call it manu

Re: [PHP-DEV] __toString()

2003-12-14 Thread George Schlossnagle
On Dec 15, 2003, at 1:37 AM, Jon Parise wrote: On Mon, Dec 15, 2003 at 01:32:57AM -0500, George Schlossnagle wrote: Nope. How is it different or nicer than doing $defect->thrownException()->__toString()? It saves you 4 characters? If it doesn't do anything 'magical', why bother with the __? If y

Re: [PHP-DEV] __toString()

2003-12-14 Thread Jon Parise
On Mon, Dec 15, 2003 at 01:48:39AM -0500, George Schlossnagle wrote: > >>interface Stringable { > >>public function toString(); > >>} > >> > >>And that way extensions and user code both can decide if they want to > >>give special treatment to objects that implement Stringable. > > > >I thi