Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Ferdinand Beyer
On 18 Feb 2004 at 21:02, Michael Walter wrote: > This is rather wrong - one of C++' main strengths is that it allows > multiple paradigms of programming (procedural, object-oriented, generic, > generative, functional, ...) which can also be mixed etc. Instead of > ideologically focusing on onl

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Brad Fisher
Ferdinand Beyer wrote: > On 18 Feb 2004 at 11:02, Brad Fisher wrote: > > > For one because PHP doesn't allow method overloading. If I have > a method > > A::foo($a), and I want to change the prototype in B to B::foo($x, > $y), then ...snip... > > (like C::A_foo) which then calls A::foo internal

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Michael Walter
Ferdinand Beyer wrote: > [...] C++ is difficult since it includes C. Nevertheless every C++ programmer is 100% coding (and thinking) object-oriented - even basic data types like strings are usually objects. This is rather wrong - one of C++' main strengths is that it allows multiple paradigms o

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Ferdinand Beyer
On 18 Feb 2004 at 20:21, Michael Walter wrote: > What is your criterium of a language being an "OO language"? Why is it > that you consider C++ as an OO language, but not PHP? C++ is difficult since it includes C. Nevertheless every C++ programmer is 100% coding (and thinking) object-oriented

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Michael Walter
Ferdinand Beyer wrote: > [...] Well, I must confess that I do not know Perl (perhaps I'm to young). But I said "not available in any OO language" - neither Perl nor PHP are OO languages in my opinion (like Java, C++) so we should not use Perl as a role model here :-) What is your criterium of a

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Ferdinand Beyer
On 18 Feb 2004 at 11:02, Brad Fisher wrote: > For one because PHP doesn't allow method overloading. If I have a method > A::foo($a), and I want to change the prototype in B to B::foo($x, $y), then > there is no way for me to call the original A::foo. I could use optional > params to emulate t

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Brad Fisher
Ferdinand Beyer wrote: > On 17 Feb 2004 at 14:01, Brad Fisher wrote: > > > class D { > > function bar() { > > $c = new C; > > // I'd like to call the A::foo method of C here... > > //In PHP4, I could do something like: > > Why should one want to do that? Why should PHP allow this

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Ferdinand Beyer
On 17 Feb 2004 at 14:01, Brad Fisher wrote: > class D { > function bar() { > $c = new C; > // I'd like to call the A::foo method of C here... > //In PHP4, I could do something like: Why should one want to do that? Why should PHP allow this? $c is not an A, it is a C. Of course

[PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-17 Thread Brad Fisher
Since you can no longer assign to $this in PHP5, how would one call a method defined in a particular ancestor class that has been overridden by the current class or a more recent ancestor? In PHP4 doing this was hackish, but worked. For example: class A { function foo() { echo "A::foo";