Bug #12850 Updated: May a feature to add?
| From: | ssb@php.net | Date: | Mon, 20 Aug 2001 07:38:49 +0000 |
| Subject: | Bug #12850 Updated: May a feature to add? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-63808@lists.php.net to get a copy of this message | ||
ID: 12850
Updated by: ssb
Reported By: al@humantouch.de
Old Status: Open
Status: Closed
Bug Type: Class/Object related
Operating System: Red Hat
PHP Version: 4.0.4pl1
New Comment:
If you need to call specific class methods, use test::test1() instead of $this->test1(). The
$this variable will still be defined.
Previous Comments:
------------------------------------------------------------------------
[2001-08-20 01:34:37] al@humantouch.de
Hi,
here is a tricky thing using the parent:: keyword:
There seems to be no way to call a parent function out of a
parent function!
<?php
class test {
function test1(){
echo "parent:test1<br>";
}
function test2(){
echo "parent:test2<br>";
$this->test1();
}
}
class sub extends test {
function test1(){
echo "sub:test1<br>";
}
function test2(){
echo "sub:test2<br>";
parent::test2();
}
}
$a = new sub();
$a->test2();
?>
returns:
sub:test2
parent:test2
sub:test1
Greetings,
Alex
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12850&edit=1