If non-static method can be static without any bad impact on code?

johnny_vr

New Member
I'm new to OOP. I saw an example at below. the \[code\]getStudentName()\[/code\] has been set as a static method. Based on the OOP knowledge I have, this method should be a non-static method.However, the code is still work even though it is wrong. I would like to know if non-static method can be static without any bad impact on code?BTW, the code is writing by PHP.\[code\]class student{ public static function getStudentName($studentID){ .... return $studentName; }}$stuName = student::getStudentName($stuID)\[/code\]
 
Back
Top