|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-02-13 16:00 UTC] White_Angel at gmx dot 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 ?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 09:00:01 2025 UTC |
Can't reproduce this here either: thekid@friebes:~ > cat | php5 <?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(); ?> 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