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

From: Date: Thu, 13 Feb 2003 22:14:12 +0000
Subject: #22214 [Fbk]: On Class Extend mainClass no Vars are inherite
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-33091@lists.php.net to get a copy of this message
ID: 22214 Updated by: nicos@php.net Reported By: White_Angel@gmx.de Status: Feedback Bug Type: Zend Engine 2 problem Operating System: Linux PHP Version: 5CVS-2003-02-13 (dev) New Comment: Be sure you use the correct binary (if you use CLI) with ZE2 and tell us. (php -v might help in that case) Thank you. Previous Comments: ------------------------------------------------------------------------ [2003-02-13 16:09:48] White_Angel@gmx.de Yes. updated 5 minutes ago. I Will checkout my sources new... perhaps... ------------------------------------------------------------------------ [2003-02-13 16:06:02] nicos@php.net 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? ------------------------------------------------------------------------ [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 (#33091) next »