Re: [PHP-DEV] Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Andrey Hristov
Andrey Hristov wrote: >>. >>. ah, the code has an error and I found more efficient way (for objects no need of string compare): class Fubar { protected function doSomething_integer_integer_double($i1,$i2,$f) { $a = func_get_args();var_dump(__METHOD__, $a); } protected function doSome

Re: [PHP-DEV] Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Andrey Hristov
George Schlossnagle wrote: >> .. $a = new fubar(); $a->doSomething(1, 2.0); $a->doSomething(3,4, 5.0); ?> The problem with this is that that integer may well be a string when you look at it. There's no good way to do this past discriminating between scalar, array and object (by type, of course

Re: [PHP-DEV] Re: Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Jason Garber
If it makes any difference... I would say no way to multi method dispatch. PHP, in my understanding, was a loosely typed language, and this is straining against that very concept. In the rare case that one needs multi-method dispatch, they can use a format such as: class xyz { public fun

Re: [PHP-DEV] Re: Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Michael Walter
Christian Schneider wrote: Sebastian Bergmann wrote: Since we introduce class type hints in PHP 5.0 I think it would be a good thing [tm] to add multi-method dispatch in PHP 5.1. Actually I think multi-method dispatching for PHP is A Bad Thing[tm]. Multi-method dispatching is necessary for

[PHP-DEV] limit for mmaping for readfile (Bug #19749)

2004-04-20 Thread Wez Furlong
http://bugs.php.net/bug.php?id=19749 It's been playing on my mind recently that this bug hasn't been addressed; the problem was how to guess precisely what limit to set for mmaping when doing something like readfile(). [note that some comments are missing from the bugdb for that bug] Well, we can

[PHP-DEV] Re: Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Christian Schneider
Sebastian Bergmann wrote: Since we introduce class type hints in PHP 5.0 I think it would be a good thing [tm] to add multi-method dispatch in PHP 5.1. Actually I think multi-method dispatching for PHP is A Bad Thing[tm]. Multi-method dispatching is necessary for statically checked, inflexible

Re: [PHP-DEV] Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread George Schlossnagle
On Apr 20, 2004, at 3:18 PM, Marcus Boerger wrote: The problem with this is that that integer may well be a string when you look at it. There's no good way to do this past discriminating between scalar, array and object (by type, of course). I personally think that that is fine (adding an array

Re: [PHP-DEV] Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Marcus Boerger
Hello George, Tuesday, April 20, 2004, 8:57:31 PM, you wrote: > On Apr 20, 2004, at 2:51 PM, Andrey Hristov wrote: >> Quoting Sebastian Bergmann <[EMAIL PROTECTED]>: >> >>> Since we introduce class type hints in PHP 5.0 I think it would be a >>> good thing [tm] to add multi-method dispatch i

Re: [PHP-DEV] Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread George Schlossnagle
On Apr 20, 2004, at 2:51 PM, Andrey Hristov wrote: Quoting Sebastian Bergmann <[EMAIL PROTECTED]>: Since we introduce class type hints in PHP 5.0 I think it would be a good thing [tm] to add multi-method dispatch in PHP 5.1. What I mean by this would be to allow for the following: clas

Re: [PHP-DEV] Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Andrey Hristov
Quoting Sebastian Bergmann <[EMAIL PROTECTED]>: > Since we introduce class type hints in PHP 5.0 I think it would be a > good thing [tm] to add multi-method dispatch in PHP 5.1. > > What I mean by this would be to allow for the following: > > class Foo { > public function doSom

Re: [PHP-DEV] tidy patch?

2004-04-20 Thread John Coggeshall
Done. On Tue, 2004-04-20 at 11:43, Andi Gutmans wrote: > I asked John to apply it. I prefer him to make sure it's OK (although I > looked over it and it looks fine). > > At 04:31 PM 4/20/2004 +0100, Nuno Lopes wrote: > >Hello, > > > >It seems that nobody applied my patch to tidy (maybe because o

[PHP-DEV] PHP5 configure options

2004-04-20 Thread Marcus Bointon
I'm building PHP 5RC1 and 4.3.6 on a RH ES3 Linux box. 4.3.6 builds and runs perfectly - the same configure options on PHP 5 produces a build, but gives runtime errors about undefined symbols at PHP startup (e.g. In response to php -v). I then failed to find any docs on differences in compile time

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread George Schlossnagle
On Apr 20, 2004, at 11:39 AM, Ferdinand Beyer wrote: On 20 Apr 2004 at 11:22, George Schlossnagle wrote: PHP doesn't support this, regardless of you being able to tell them apart, scalar types in PHP are isomorphic. Yes, I know. This is why I am against strict parameter checking. Everything works

Re: [PHP-DEV] tidy patch?

2004-04-20 Thread Andi Gutmans
I asked John to apply it. I prefer him to make sure it's OK (although I looked over it and it looks fine). At 04:31 PM 4/20/2004 +0100, Nuno Lopes wrote: Hello, It seems that nobody applied my patch to tidy (maybe because of the hot discussion). Please review it here: http://news.php.net/article

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Ferdinand Beyer
On 20 Apr 2004 at 11:22, George Schlossnagle wrote: > PHP doesn't support this, regardless of you being able to tell them > apart, scalar types in PHP are isomorphic. Yes, I know. This is why I am against strict parameter checking. > > Provided that one has access to the interfaces... > > I mu

[PHP-DEV] tidy patch?

2004-04-20 Thread Nuno Lopes
Hello, It seems that nobody applied my patch to tidy (maybe because of the hot discussion). Please review it here: http://news.php.net/article.php?group=php.internals&article=9338 It fixes a bug and completes the changes to the StudlyCaps convention. It also frees up some memory, because I've rem

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread George Schlossnagle
On Apr 20, 2004, at 11:14 AM, Ferdinand Beyer wrote: On 20 Apr 2004 at 17:55, Stanislav Malyshev wrote: FB>>Impl guarantees that by implementing interface A. No. It _says_ it implements interface A, but you couldn't know if it indeed does, if we allow your model - maybe that "dispatched" functio

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Ferdinand Beyer
On 20 Apr 2004 at 17:55, Stanislav Malyshev wrote: > FB>>Impl guarantees that by implementing interface A. > > No. It _says_ it implements interface A, but you couldn't know if it > indeed does, if we allow your model - maybe that "dispatched" function > call doesn't really accept those argume

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Stanislav Malyshev
FB>>Impl guarantees that by implementing interface A. No. It _says_ it implements interface A, but you couldn't know if it indeed does, if we allow your model - maybe that "dispatched" function call doesn't really accept those arguments? FB>>What if Impl::doSomething() would accept exactly two

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread George Schlossnagle
On Apr 20, 2004, at 10:48 AM, Ferdinand Beyer wrote: On 20 Apr 2004 at 17:38, Stanislav Malyshev wrote: FB>>interface A { FB>>public function doSomething($integer1, $integer2); FB>>} FB>> FB>>interface B { FB>> public function doSomething(MyObject $obj); FB>>} FB>> FB>>class Impl implements

[PHP-DEV] Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Sebastian Bergmann
Since we introduce class type hints in PHP 5.0 I think it would be a good thing [tm] to add multi-method dispatch in PHP 5.1. What I mean by this would be to allow for the following: class Foo { public function doSomething(Foo $foo) {} public function doSomething(Bar $b

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Ferdinand Beyer
On 20 Apr 2004 at 17:38, Stanislav Malyshev wrote: > FB>>interface A { > FB>>public function doSomething($integer1, $integer2); > FB>>} > FB>> > FB>>interface B { > FB>> public function doSomething(MyObject $obj); > FB>>} > FB>> > FB>>class Impl implements A, B > FB>>{ > FB>>// "Overload

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Sebastian Bergmann
Andi Gutmans wrote: > And regular old-style inheritance? If you mean class Foo { public function doSomething($a, $b) {} } class Bar extends Foo { public function doSomething($c, $d, $e) {} } by "regular old-style inheritance" then no. It would not make sense to

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Stanislav Malyshev
FB>>interface A { FB>>public function doSomething($integer1, $integer2); FB>>} FB>> FB>>interface B { FB>> public function doSomething(MyObject $obj); FB>>} FB>> FB>>class Impl implements A, B FB>>{ FB>>// "Overloaded" - supports both doSomething() interfaces FB>>public function doSom

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Ferdinand Beyer
On 19 Apr 2004 at 20:44, Marcus Boerger wrote: > Simply decalre thos methos with an empty signature and use the > appropriate functions to handle the arguments? That does not work for foreign/internal interfaces/base classes. Again: Why should we add this strictness? Since PHP is loosely typed,

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Adam Maccabee Trachtenberg
On Tue, 20 Apr 2004, George Schlossnagle wrote: > On Apr 20, 2004, at 3:22 AM, Derick Rethans wrote: > > > On Mon, 19 Apr 2004, Sterling Hughes wrote: > > > >> mo compile errors mo better. > > > > But NOT for normal methods! > > I agree with Derick. Compile errors for interfaces methods good. > C

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread George Schlossnagle
On Apr 20, 2004, at 3:22 AM, Derick Rethans wrote: On Mon, 19 Apr 2004, Sterling Hughes wrote: mo compile errors mo better. But NOT for normal methods! I agree with Derick. Compile errors for interfaces methods good. Compile errors for normal inherited methods bad. Derick -- PHP Internals -

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Stanislav Malyshev
ZS>>I believe that this behavior is wrong. I believe that classes should ZS>>not be allowed to say they implement an interface X, unless they ZS>>actually implement all of the methods in that interface with methods ZS>>that are compatible with its prototypes. I agree. Since interfaces and abstrac

Re: [PHP-DEV] Patch for making static method calls work from within xslt

2004-04-20 Thread Christian Stocker
On 4/20/04 11:19 AM, Andi Gutmans wrote: Oh :) I thought that was zend_is_callable(). I'm OK with you commiting this. It's a small one and quite useful. Thanks. Comited. chregu Andi At 11:11 AM 4/20/2004 +0200, Christian Stocker wrote: On 4/20/04 11:05 AM, Andi Gutmans wrote: Hi, From loo

Re: [PHP-DEV] Patch for making static method calls work from within xslt

2004-04-20 Thread Andi Gutmans
Oh :) I thought that was zend_is_callable(). I'm OK with you commiting this. It's a small one and quite useful. Andi At 11:11 AM 4/20/2004 +0200, Christian Stocker wrote: On 4/20/04 11:05 AM, Andi Gutmans wrote: Hi, From looking at the non-whitespace diff I don't quite understand what you cha

Re: [PHP-DEV] Patch for making static method calls work from within xslt

2004-04-20 Thread Christian Stocker
On 4/20/04 11:05 AM, Andi Gutmans wrote: Hi, From looking at the non-whitespace diff I don't quite understand what you changed (except for adding an error message if it's not callable). What am I missing? the zend_make_callable() was missing. it didn't work without that. chregu Andi At 1

Re: [PHP-DEV] Patch for making static method calls work from within xslt

2004-04-20 Thread Andi Gutmans
Hi, From looking at the non-whitespace diff I don't quite understand what you changed (except for adding an error message if it's not callable). What am I missing? Andi At 11:00 AM 4/20/2004 +0200, Christian Stocker wrote: Hi I made a patch for making static php method calls (ala class::metho

[PHP-DEV] Patch for making static method calls work from within xslt

2004-04-20 Thread Christian Stocker
Hi I made a patch for making static php method calls (ala class::method) work from within xslt. (see http://slides.bitflux.ch/phpug2004_1/slide_37.html for some details about this technique) I'm not sure, if I can commit that now in this stage of the release process. Would be great, if it woul

Re: [PHP-DEV] Interface inheritance

2004-04-20 Thread Derick Rethans
On Mon, 19 Apr 2004, Sterling Hughes wrote: > mo compile errors mo better. But NOT for normal methods! Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php