Technical Questions Based On PHP
Technical Questions Based On PHP
• If class implementing the interface does not use exact same method signatures as are
defined in the interface. Will show.
Compilation error
• If property of class is declare using var then PHP5 will treat the property as?
It accelerates as public property.
• Which PHP function or variable will return the value of current session id?
SESSION_ID() is used to get set the session id for the current session.
• What is the simplest method of computing the sum of all the elements of an array?
The array Sum() function
• Which object-oriented pattern would you use to implement a class that must be
instantiated only once for the entire lifespan of a script?
Singleton
• In PHP 5, how can you write a class so that some of its properties cannot be accessed
from outside its methods?
In PHP 5, you can achieve encapsulation, which restricts access to certain class
properties from outside its methods, by using the private visibility modifier for those
properties.
• list in PHP is ?