Link to home
Start Free TrialLog in
Avatar of Tech_View
Tech_View

asked on

PHP Error : Connot Access Empty Refrence

Hello. I am not familiar with PHP. I have an error: Connot Access Empty Refrence.
My Code is:

<?php
      class Student{
            var $name;
            function Student($n){
                  $this->$name = $n;
            }
            function sayHello(){
                  $
print $this->$name";
            }
      }
      $std1 = new Student("reza");
      $std1->sayHello();
?>

Help please.
ASKER CERTIFIED SOLUTION
Avatar of Zibings
Zibings

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tech_View
Tech_View

ASKER

I will try it ....
I still have an error, maybe my mistake, I will try again....