0

Something wrong with my code

Please can anybody check why i am getting error; <?php class Student_record{ public $name; public $stream; public $gpa; public $project; function__construct($Name,$Stream,$Gpa,$Project){ $this->$name=$Name; $this->$stream=$Stream; $this->$gpa=$Gpa; $this->$project=$Project; } function_Hashonars(){ if(this->$gpa>4){ echo $this->name" has got honars"; }} } $student_record1= new Student(Harsh,IT,3.5,"Php backend") $student_record1->_Hashonors(); phpinfo(); ?>

19th Aug 2020, 2:26 PM
Harsh D H A W L E
Harsh D H A W L E - avatar
2 odpowiedzi
+ 2
Can you send this as code so that I can workout.
19th Aug 2020, 3:35 PM
Steve Sajeev
Steve Sajeev - avatar
0
Many problem was found : ) Please refer to and compare with this edited version to see what was wrong https://code.sololearn.com/wp30pql4Khs6/?ref=app
19th Aug 2020, 9:51 PM
Ipang