Dear all,
Why below program not working .It gives fatal error.
NOT WORKING
<?php
class Class_access{
const a="50";
public $bb="Class Variable \n";
function display(){
//$Function_Variable;
echo "Function Display \n ";
//echo $this->bb;
}
}
$obj=new Class_access();
$obj->display();
echo Class_access::a;
echo "\n";
echo Class_access::$bb;
?>
WOKING
======
<?php
class Class_access{
const a="50";
public static $bb="Class Variable \n";
function display(){
//$Function_Variable;
echo "Function Display \n ";
//echo $this->bb;
}
}
$obj=new Class_access();
$obj->display();
echo Class_access::a;
echo "\n";
echo Class_access::$bb;
?>
Can any one help me out .What is the difference among them.
Thank you,
With Regards,
Prem