Jnr PHP/Codeigniter Developer

  Home  Web Development  Jnr PHP/Codeigniter Developer


“Jnr PHP/Codeigniter Developer Frequently Asked Questions in various Jnr PHP/Codeigniter Developer job interviews by interviewer. The set of questions are here to ensures that you offer a perfect answer posed to you. So get preparation for your new job interview”



61 Jnr PHP/Codeigniter Developer Questions And Answers

24⟩ Tell me what are the 3 scope levels available in PHP and how would you define them?

☛ 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.

 215 views

25⟩ Tell me the different types of errors in PHP?

Those are Notices, Warnings and Fatal errors are the types of errors in PHP. Notices represents non-critical errors. Warnings are more serious errors but they do not result in script termination. Fatal errors are critical errors i.e. calling a non-existent function or class. These errors cause the immediate termination of the script.

 167 views

26⟩ What is routing in Codeigniter?

In CodeIgniter, the way PHP files served is different rather than accessing it directly from the browser. This process is called routing. Routing in CodeIgniter gives you freedom to customize the default URL pattern to use our own URL pattern according to the requirement. So, whenever there is a request made and matches our URL pattern it will automatically direct to the specified controller and function.

 209 views

32⟩ Do you know what is Polymorphism?

It is the basic principle of OOP. You can define base class (may be abstract) Animals and it can then be extended by other classes like Dog, Cat and take part of the behaviour from the parent class.

 176 views

35⟩ Tell me do you use Composer? If yes, what benefits have you found in it?

Using Composer is a tool for dependency management. The candidate can declare the libraries your product relies on and Composer will manage the installation and updating of the libraries. The benefit is a consistent way of managing the libraries depended on so less time is spent managing the libraries.

 177 views

37⟩ Please explain what are the security parameter for XSS in CodeIgniter?

Codeigniter has got a cross-site scripting hack prevention filter. This filter either runs automatically or you can run it as per item basis, to filter all POST and COOKIE data that come across. The XSS filter will target the commonly used methods to trigger JavaScript or other types of code that attempt to hijack cookies or other malicious activity. If it detects any suspicious thing or anything disallowed is encountered, it will convert the data to character entities.

 247 views

38⟩ Explain me what are getters and setters and why are they important?

Getters and setters are methods used to declare or obtain the values of variables, usually private ones. They are important because it allows for a central location that is able to handle data prior to declaring it or returning it to the developer. Within a getter or setter one is able to consistently handle data that will eventually be passed into a variable or additional functions. An example of this would be a user’s name. If a setter is not being used and the developer is just declaring the $userName variable by hand, you could end up with results as such: "kevin", "KEVIN", "KeViN", "", etc. With a setter, the developer can not only adjust the value, for example, ucfirst($userName), but can also handle situations where the data is not valid such as the example where "" is passed. The same applies to a getter – when the data is being returned, it can be modifyed the results to include strtoupper($userName) for proper formatting further up the chain.

This is important for any developer who is looking to enter a team-based / application development job to know. Getters and setters are often used when dealing with objects, especially ones that will end up in a database or other storage medium. Because PHP is commonly used to build web applications, developers will run across getters and setters in more advanced environments. They are extremely powerful yet not talked about very much. It is impressive if a developer shows that he/she knows what they are and how to use them early on.

 169 views