Jnr PHP/Codeigniter Developer Question:
Download Job Interview Questions and Answers PDF
Tell me what are the 3 scope levels available in PHP and how would you define them?
Answer:
☛ Private – Visible only in its own class
☛ Public – Visible to any other code accessing the class
☛ Protected – Visible only to classes parent(s) and classes that extend the current class
This is important for any PHP developer to know because it shows an understanding that building applications is more than just being able to write code. One must also have an understanding about privileges and accessibility of that code. There are times protected variables or methods are extremely important, and an understanding of scope is needed to protect the integrity of the data in your application along with provide a clear path through the code.
☛ Public – Visible to any other code accessing the class
☛ Protected – Visible only to classes parent(s) and classes that extend the current class
This is important for any PHP developer to know because it shows an understanding that building applications is more than just being able to write code. One must also have an understanding about privileges and accessibility of that code. There are times protected variables or methods are extremely important, and an understanding of scope is needed to protect the integrity of the data in your application along with provide a clear path through the code.
Download Jnr PHP/Codeigniter Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Tell me how you can link images/CSS/JavaScript from a view in code igniter? | Tell me the different types of errors in PHP? |