[PHP-DEV] CVS Account Request: cweiske

2004-02-26 Thread Christian Weiske
PHP-Gtk-docs. Steph Fox sent me to here. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DEV] CVS Account Request: cweiske

2004-02-26 Thread Steph
Please could someone activate an account for Christian? He just wrote the documentation for an entire PHP-GTK extension! > -Original Message- > From: Christian Weiske [mailto:[EMAIL PROTECTED] > Sent: 26 February 2004 11:45 > To: [EMAIL PROTECTED] > Subject: [PHP-DEV] CVS Account Request:

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 e

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

2004-02-26 Thread Andrey Hristov
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. And as a consequence maybe interfaces shouldn't allow constructors. Does inheritance include visibility rules? ;) Andrey -- PHP Inter

Re: [PHP-DEV] segfault with iterators

2004-02-26 Thread Pierre-Alain Joye
On Wed, 25 Feb 2004 21:56:08 +0200 [EMAIL PROTECTED] (Andi Gutmans) wrote: > Nope. I don't have time to add one right now... > Pierre got time? :) > If not I'll try and do it within the next few days. Here it is. I put it in tests/lang/foreach_with_new_object_001.phpt hth pierre -- PHP Inter

Re: [PHP-DEV] segfault with iterators

2004-02-26 Thread Pierre-Alain Joye
On Thu, 26 Feb 2004 14:02:38 +0100 [EMAIL PROTECTED] (Pierre-Alain Joye) wrote: > Here it is. > > I put it in tests/lang/foreach_with_new_object_001.phpt take #2, .txt :) --TEST-- foreach() with foreach($o->mthd()->arr) --FILE-- c()->a as $value) { print "$value\n"; } --EXPECT-- 1 2 3 4 5

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

2004-02-26 Thread Philip Fletcher
At the risk of making a complete fool of myself, I'd like to ask the smarter brains than me to checkout the current logic in the implementation of Iterator classes and foreach(). The current logic of foreach( $obj as $key => $val ) { ... } where $obj implements Iterator, is: for($obj->rewind(); $

Re: [PHP-DEV] CVS Account Request: cweiske

2004-02-26 Thread Andrei Zmievski
On Thu, 26 Feb 2004, Steph wrote: > Please could someone activate an account for Christian? He just wrote the > documentation for an entire PHP-GTK extension! Done. -Andrei "The weather we gets is the weather we got, So we're gonna have weather, whether or not." ~ Wendell Hall, nineteen

[PHP-DEV] PHP5: Class behavior: method overloading

2004-02-26 Thread Vivian Steller
Hello, in the latest snapshot i found some very important differences to the php5 beta 4 version concerning the behavior of inherited classes. please look at the following example: the output is: Fatal error: Declaration of MyClass::test() must be compatible with that of MyParent::test() in

Re: [PHP-DEV] PHP5: Class behavior: method overloading

2004-02-26 Thread Walter A. Boring IV
I say keep compatibility. If you want to enforce this, then declare an interface. That is after all why they exist. Walt > Hello, > > in the latest snapshot i found some very important differences to the php5 > beta 4 version concerning the behavior of inherited classes. please look at > the f

Re: [PHP-DEV] PHP5: Class behavior: method overloading

2004-02-26 Thread Vivian Steller
Walter A. Boring IV wrote: > I say keep compatibility. If you want to enforce this, then declare an > interface. That is after all why they exist. > > Walt ... Would be nice if you could give a simple example - i really have problems working with interfaces :( My problem was to design a files

Re: [PHP-DEV] PHP5: Class behavior: method overloading

2004-02-26 Thread Derick Rethans
On Thu, 26 Feb 2004, Vivian Steller wrote: > Fatal error: Declaration of MyClass::test() must be compatible with that of > MyParent::test() in ... on line 3 > > > I think that this is a nice feature in the face of "compatibility", but may > cause in a complete restructure of existing class trees.

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

2004-02-26 Thread Jeff Moore
On Feb 26, 2004, at 1:49 AM, Andi Gutmans wrote: You are breaking the isA relationship. We fixed this so that from now on, people will not make such mistakes anymore (I think it's the right way to go, so that we don't leave broken functionality around). You can enable compatibility mode to make

Re: [PHP-DEV] PHP5: Class behavior: method overloading

2004-02-26 Thread Walter A. Boring IV
Quoting Vivian Steller <[EMAIL PROTECTED]>: > Walter A. Boring IV wrote: > > > I say keep compatibility. If you want to enforce this, then declare an > > interface. That is after all why they exist. > > > > Walt > ... > > Would be nice if you could give a simple example - i really have proble

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

2004-02-26 Thread Marcus Boerger
Hello Andrey, Thursday, February 26, 2004, 1:08:19 PM, you wrote: > 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. And as a >> consequence maybe interfaces shouldn't al

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

2004-02-26 Thread Marcus Boerger
Hello Philip, have a look at it's dokumentation: ext/spl/spl.php there you'll find that hasMore() needs to be checked before an access to key() or current() can be done. Hence it's meaning is somewhat like isValid(). regards marcus Thursday, February 26, 2004, 4:53:50 PM, you wrote: > At the ri

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

2004-02-26 Thread Philip Fletcher
Thanks Marcus 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?'. This makes the api very ambiguous - hasMore() and isValid() have

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

2004-02-26 Thread Andrei Zmievski
On Thu, 26 Feb 2004, Philip Fletcher wrote: > Thanks Marcus > > 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?'. > > This m

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

2004-02-26 Thread Philip Fletcher
Sorry for follow-up to myself, but it would be somewhat easier to just rename hasMore() to isValid() and then implement hasMore() after PHP5 goes gold. Philip Fletcher wrote: > Whilst I appreciate adding an isValid() method to the Iterator interface > is not trivial (and I am loath to suggest a c

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

2004-02-26 Thread Marcus Boerger
Hello Philip, just to make it clear. hasMore() would be the exact same then isValid() only the name would change. The semantic is already what you refer to as isValid. Thursday, February 26, 2004, 9:43:40 PM, you wrote: > Sorry for follow-up to myself, but it would be somewhat easier to just > r

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

2004-02-26 Thread Philip Fletcher
Hi Marcus Yes, the current implementation of hasMore() has an identical semantic to isValid(). The generally understood semantic of isValid() and hasMore() are quite different - hence the need for the rename. Regards Philip Marcus Boerger wrote: > Hello Philip, > > just to make it clear. has

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

2004-02-26 Thread Marcus Boerger
Hello Philip, Thursday, February 26, 2004, 10:05:09 PM, you wrote: > Hi Marcus > Yes, the current implementation of hasMore() has an identical semantic to > isValid(). > The generally understood semantic of isValid() and hasMore() are quite > different - hence the need for the rename. As a sid

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

2004-02-26 Thread Philip Fletcher
Marcus Boerger wrote: > As a side note: There is no generally understood hasMore(). I strongly disagree - the Java Iterator has a hasNext() method which is the exact sementic of hasMore(). > Though there > is isDone() and hasMore() is sometimes used/implemented as !isDone(). The > main problem

[PHP-DEV] Fix for #27291 (get_browser() problems)

2004-02-26 Thread Jay Smith
Hey all, I think I have a fix for the problems in get_browser() as per the bug report. (#27291: get_browser matches browscap.ini patterns incorrectly) Gary Keith, who handles the browscap.ini file we suggest in the get_browser() docs, uses IIS/ASP's browscap.dll for his benchmarking and I believ

[PHP-DEV] Segfault in HEAD

2004-02-26 Thread Stefan Walk
Hi, after a cvs update i get a segfault with this script: foo = false; } public function start() { throw new Exception(); } } $test = new test(); $test->start(); ?> Backtrace: #0 0x in ?? () #1 0x081656a2 in execute (op_array=0x40206284) at /home/et/cvs.php.net/php-src/Z

[PHP-DEV] Bogus Error Message?

2004-02-26 Thread John Coggeshall
getDocComment(); if(!empty($docs)) { echo "Has Docs.\n"; } if(!empty($reflect->getDocComment())) { echo "Has Docs.\n"; } ?> [EMAIL PROTECTED] ]$ php test.php Fatal error: Can't use method return value in write context in test.php on line 10 Since when i

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

2004-02-26 Thread Zeev Suraski
At 03:28 26/02/2004, Derick Rethans wrote: On Thu, 26 Feb 2004, Marcus Boerger wrote: > Hello Timm, > > well for normal methods we must do that. The derived class must support the > same signature that the base class supports. In you example that would only > work if the derived method would have

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

2004-02-26 Thread Zeev Suraski
At 07:19 26/02/2004, Hans Lellelid wrote: 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*

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

2004-02-26 Thread George Schlossnagle
On Feb 26, 2004, at 11:49 PM, Zeev Suraski wrote: At 07:19 26/02/2004, Hans Lellelid wrote: 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 als

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 it

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

2004-02-26 Thread Adam Maccabee Trachtenberg
On Fri, 27 Feb 2004, George Schlossnagle wrote: > This is an enormously huge bc break. Error-prone or not, I would wager > that 95%+ of all php4 OO code exploits the ability to redefine the > signature on inherited methods. So far, I've identified that this breaks more than one important PEAR pa

Re: [PHP-DEV] Improved NetWare diff - 2.

2004-02-26 Thread Ananth Kesari
Hi, Both with Apache 1.3 and with Apache 2.0, we could see memory leaks even if we execute static html pages and not php scripts. This patch fixes this problem, but is under #ifdef NetWare. See the files: sapi/apache/mod_php5.c and sapi/apache2filter/sapi_apache2.c. If it is deemed so, then we can

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

2004-02-26 Thread Michael Walter
Ferdinand Beyer wrote: IMO we are trying to force a strict programming here that is incompatible with PHP's loose character. Well, I don't get the point in relation to *constructors* at all.. I mean, forcing the same signature for each constructor seems unreasonable to me (_when explicitely cal

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

2004-02-26 Thread Ferdinand Beyer
IMO we are trying to force a strict programming here that is incompatible with PHP's loose character. The following example for instance is very common in Java AVT programming: Furthermore with the new implementation we disallow "the PHP way for overloaded methods" using a variable parameter

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

2004-02-26 Thread Derick Rethans
On Thu, 26 Feb 2004, Marcus Boerger wrote: > Hello Timm, > > well for normal methods we must do that. The derived class must support the > same signature that the base class supports. In you example that would only > work if the derived method would have a default parameter for the additional > pa

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

2004-02-26 Thread Derick Rethans
On Thu, 26 Feb 2004, Timm Friebe wrote: > On Thu, 2004-02-26 at 01:38, Marcus Boerger wrote: > > Hello Timm, > [...] > > > Should work #1, Bar::connect() adds an argument > > No the sugnature is incompatible. An instance of Foo cannot be called > > with Bar or Connector's connect() Signature. Henc

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

2004-02-26 Thread Derick Rethans
On Thu, 26 Feb 2004, Andi Gutmans wrote: > At 18:54 25/02/2004 -0500, Hans Lellelid wrote: > >It seems now that PHP is no longer inconsistent, but it also seems that it > >is impossible to override methods w/ incompatible signature. Is that a > >correct assessment? This is a pretty big differenc

[PHP-DEV] Segfault in HEAD

2004-02-26 Thread Sebastian Bergmann
zend_fetch_obj_w_handler(_zend_execute_data * 0x0012f488, _zend_op * 0x00c68660, _zend_op_array * 0x00c67588, void * * * 0x009742d0) line 2044 + 12 bytes execute(_zend_op_array * 0x00c67588, void * * * 0x009742d0) line 1339 + 23 bytes zend_do_fcall_common_helper(_zend_execute_data * 0x0012f610, _ze

Re: [PHP-DEV] phpMyAdmin-2.5.6-rc2 does not work with HEAD

2004-02-26 Thread Sebastian Bergmann
Sebastian Bergmann wrote: > Fatal error: Can't use function return value in write context in > C:\Server\htdocs\phpMyAdmin\libraries\common.lib.php on line 307 > > 307: define('PMA_MYSQL_CLIENT_API', \ > (int)sprintf('%d%02d%02d', $client_api[0], $client_api[1], \ > intval

Re: Fwd: [PHP-DEV] RC1

2004-02-26 Thread Marcus Boerger
Hello Timm, i think this is not completley correct. When reflection is used from a static member of the class itself it should still work. We have functions which enable such checks. Could you have a try with those? Also i have already incorporated the other patch so you need to update the engine