Interfaces in PHP
Class inheritance enables you to describe a parent-child relationship between classes. For example, you might have a base class Shape from which both Square and Circle derive. Howe
Read tutorialTHE TUTORIAL LIBRARY
Class inheritance enables you to describe a parent-child relationship between classes. For example, you might have a base class Shape from which both Square and Circle derive. Howe
Read tutorialThe instanceof operator was added as syntactic sugar instead of the already existing is_a() built-in function (which is now deprecated). Unlike the latter, instanceof is used like
Read tutorialPHP supports two reserved class names that make it easier when writing OO applications. self:: refers to the current class and it is usually used to access static members, methods,
Read tutorialThe subject of polymorphism is probably the most important in OOP. Using classes and inheritance makes it easy to describe a real-life situation as opposed to just a collection of
Read tutorialSimilar to static properties, PHP supports declaring methods as static. What this means is that your static methods are part of the class and are not bound to any specific object i
Read tutorialClasses can declare properties. Each instance of the class (i.e., object) has its own copy of these properties. However, a class can also contain static properties. Unlike regular
Read tutorialAccess modifiers may also be used in conjunction with object methods, and the rules are the same:
Read tutorialA key paradigm in OOP is encapsulation and access protection of object properties (also referred to as member variables). Most common OO languages have three main access restrictio
Read tutorialDestructor functions are the opposite of constructors. They are called when the object is being destroyed (for example, when there are no more references to the object). As PHP mak
Read tutorialInstances of classes are created using the new keyword. What happens during the new call is that a new object is allocated with its own copies of the properties defined in the clas
Read tutorialThe main difference in OOP as opposed to functional programming is that the data and code are bundled together into one entity, which is known as an object. Object-oriented applica
Read tutorialThe start expression is evaluated only once when the loop is reached. Usually it is used to initialize the loop control variable. The truth expression is evaluated in the beginning
Read tutorialOne example today. A better developer tomorrow.