Bug #11073 Updated: parent::Function() does not work if parent class is included

From: Date: Sun, 11 Nov 2001 11:11:28 +0000
Subject: Bug #11073 Updated: parent::Function() does not work if parent class is included
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-70081@lists.php.net to get a copy of this message
ID: 11073 Updated by: sander Reported By: symetrie@online.fr Old Status: Feedback Status: Closed Bug Type: Class/Object related Operating System: Linux SuSE 6.4 PHP Version: 4.0.4pl1 New Comment: No feedback. Closing. Previous Comments: ------------------------------------------------------------------------ [2001-10-21 19:24:08] sniper@php.net Works for me with PHP 4.1.0RC1. Try from: http://www.php.net/~ssb/php-4.1.0RC1.tar.gz --Jani ------------------------------------------------------------------------ [2001-05-23 21:47:24] symetrie@online.fr test1.php contains : <?php class a { function MyFunct($i, $j, $k='defaut_k') { echo " in a "; } } ?> test2.php contains <?php include("test1.php"); class b extends a { function MyFunct($i, $j, $k='defaut_k') { echo " in b "; parent::MyFunct($i,$j,$k); // does not work // got : Fatal error: No parent class available in this context in ... a::MyFunct($i,$j,$k); // works } } whereas first example presented here works fine for me : http://www.php.net/manual/en/keyword.parent.php ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=11073&edit=1

« previous php.dev (#70081) next »