• Basic object oriented programming

      0 comments

    In a general php technical interview, they will ask basic OOP questions like follows, where a high skilled programmer also might get confused sometimes, if he does not know the basics.

    class a{
    function a(){
    echo ‘aaaa’;
    }
    }

    class b extends a{
    function b(){
    echo ‘bbbb’;
    parent::a();
    }
    }
    new b;

    The basic idea what we have to identify in this code snippet is,  whether the function names work as constructors or not?
    Yes, first it will call the function b and then it will call the function a. Which will out put,
    bbbbaaaa

  • Object Orientation with PHP5

      0 comments

    What are the differences between abstract class and interface?

    Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class.

    Interface: Interfaces are one type of class where all the methods are abstract. That means all the meth