RE: [PHP-DEV] Overloading object methods

2003-01-09 Thread John Coggeshall

This list is for the development _of_ PHP not _with_ PHP, please direct
future questions there

However, I don't understand the question you are asking... If you have
this:

Class A {

function foo() {

echo I am function fooBR;
}
}

Class B extends A {

function foo() {
echo I am the child function fooBR;
parent::foo();
}
}

$a = new B;
$a-foo();

It will output:

I am the child function foo
I am function foo

http://www.php.net/manual/en/keyword.parent.php

John


-Original Message-
From: Stefano Corsi [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 09, 2003 5:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DEV] Overloading object methods


Does someone know how to call a parent's object method? Not contructor 
(because that is easy) but a method with the same name.

For example, if I have a method that is called pippo() and at 
the end of the 
method i want to call parent::pippo(), how could I do?

I tried with call_user_function using  

(this_object-ce-parent-function_table)

as the function table, but I don't know how to pass the 
underlyig object.

Thanks,
   Stefano



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Overloading object methods

2003-01-09 Thread Stefano Corsi
Alle 09:40, giovedì 9 gennaio 2003, John Coggeshall ha scritto:
 This list is for the development _of_ PHP not _with_ PHP, please direct
 future questions there

 However, I don't understand the question you are asking... If you have
 this:

 Class A {

   function foo() {

   echo I am function fooBR;
   }
 }

Hello, I'm also the function foo. Pleased to meet you.

I'm asking how to call parent::method() from zend engine (C), not from php. 
Are questions regarding the C zend_engine API welcome?

Thanks,
Stefano

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DEV] Overloading object methods

2003-01-09 Thread Derick Rethans
On Thu, 9 Jan 2003, John Coggeshall wrote:

 
 This list is for the development _of_ PHP not _with_ PHP, please direct
 future questions there
 
 However, I don't understand the question you are asking... If you have
   ^^^
Then don't reply?

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php