Category: PHP Tutorial

python tutorials and learn python

Created with Sketch.

PHP Magic Methods

PHP Magic Methods Summary: in this tutorial, you will learn about PHP magic methods that override the default actions when the object performs the actions. Introduction to PHP magic methods PHP magic methods are special methods in a class. The magic methods override the default actions when the object performs the actions. By convention, the…
Read more

PHP Late Static Binding

PHP Late Static Binding Summary: in this tutorial, you will learn about the PHP late static binding, which is an interesting feature that has been added to the PHP 5.3 Introduction to late static binding in PHP Let’s start with a simple example. <?php class Model { protected static $tableName = ‘Model’; public static function…
Read more

PHP Class Constants

PHP Class Constants Summary: in this tutorial, you will learn about PHP class constants and how to use them effectively. Introduction to the PHP class constants Sometimes, you need to define a constant that is specific to a class. In this case, you can use the PHP class constants. To define a constant of a…
Read more

PHP Static Methods and Properties

PHP Static Methods and Properties   Summary: in this tutorial, you will learn about PHP static methods and static properties and understand the differences between the  $this and self. Introduction to PHP static methods and properties So far, you have learned how to define a class that consists of methods and properties. To use the methods…
Read more

PHP Traits

PHP Traits Summary: in this tutorial, you will learn how to use PHP traits to share functionality across independent classes, which are not in the same inheritance hierarchy. Introduction to PHP traits Code reuse is one of the most important aspects of object-oriented programming. In PHP, you use inheritance to enable code reuse in different…
Read more

PHP Polymorphism

PHP Polymorphism Summary: in this tutorial, you will learn about the polymorphism concept in object-oriented programming. And you’ll also learn how to implement polymorphism in PHP using abstract classes or interfaces. What is polymorphism? Polymorphism is a Greek word that literally means many forms. In object-oriented programming, polymorphism is closely related to inheritance. Polymorphism allows…
Read more

PHP Interface

PHP Interface   Summary: in this tutorial, you will learn about the PHP interface and how to use an interface to define a contract between classes. Introduction to the PHP interface An interface allows you to specify a contract that a class must implement. To define an interface, you use the interface keyword as follows:…
Read more

PHP Abstract Class

PHP Abstract Class Summary: in this tutorial, you will learn how to use the PHP abstract class to define an interface for other classes to extend. Introduction to the PHP abstract class An abstract class is a class that cannot be instantiated. Typically, an abstract defines an interface for other classes to extend. To define…
Read more

PHP protected

PHP protected Summary: in this tutorial, you will learn how to use the PHP protected access modifier to allow child classes to access properties and methods of the parent class. Introduction to the PHP protected access modifier In the access modifier tutorial, you learned about the public and private access modifiers. The public properties and…
Read more

PHP Override Method

PHP Override Method Summary: in this tutorial, you will learn about the PHP overriding method and how to apply it effectively in your script. Introduction to the PHP overriding method Method overriding allows a child class to provide a specific implementation of a method already provided by its parent class. To override a method, you…
Read more