#22214 [Opn->Fbk]: On Class Extend mainClass no Vars are inherite

From: Date: Thu, 13 Feb 2003 22:06:03 +0000
Subject: #22214 [Opn->Fbk]: On Class Extend mainClass no Vars are inherite
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-33088@lists.php.net to get a copy of this message
ID: 22214 Updated by: nicos@php.net Reported By: White_Angel@gmx.de -Status: Open +Status: Feedback Bug Type: Zend Engine 2 problem Operating System: Linux PHP Version: 5CVS-2003-02-13 (dev) New Comment: I can't reproduce this with ZE2, it works just fine... Output: test1:b Content of t1:This is a simple Variable test2:a Content of t1:This is a simple Variable test1:b Content of t1:This is a simple Variable Which is just nice. Are you sure you are using latest CVS? Previous Comments: ------------------------------------------------------------------------ [2003-02-13 16:00:34] White_Angel@gmx.de To Reproduce call the following code: <?php class test1 { var $t1 = "This is a simple Variable"; function b() { echo "test1:b Content of t1:".$this->t1."\n"; } } class test2 extends test1 { function a() { echo "test2:a Content of t1:".$this->t1."\n"; } } $a = new test1; $a->b(); $a = new test2; $a->a(); $a->b(); php?> In My opinnion the Text must be printet 3 times.. But only in the first Method it will be printed. In the class test2 it is empty --> not declared ... It this a Bug or a feature ? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22214&edit=1

« previous php.bugs (#33088) next »