I am trying to display the value of variable $test in 2 functions simultaneously that reside in the same class to no avail...I am using PHP 4
Can anyone help...
PLease see code below...
Thanks Ian.
Code: Select all
///////////////// Code Calling the class class.php ///////////////
$a = new a($x=a);
$b = new b($x=b);
$a->test ='I am trying to display this in text in function a and b simultaneously please help me i\'m desperate!!!';
// Class.php *******
class a {
var $test='default';
function a($x)
{
echo"$x\n";
echo"$this->test\n";
}
}
class b extends a {
function b($x)
{
echo"$x\n";
echo"$this->test\n";
}
}