|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-08-20 03:38 UTC] ssb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 19:00:01 2025 UTC |
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