PHP Anonymous functions with examples in detail

PHP Anonymous functions

PHP Anonymous functions In this chapter, you will learn another useful feature of PHP which is PHP Anonymous functions. An anonymous function is simply a PHP function but as its name suggests, it’s anonymous, which means it’s not having any name. Then how can we use it? But first, let’s see how it looks. A normal … Read more

PHP Magic methods – Magic methods in PHP – Detailed tutorial

PHP Magic methods

What are magic methods in PHP? PHP Magic methods are a special kind of method defined in OOP PHP,  which gets called automatically when a certain event occurs on an object of a class. PHP Magic methods names start with double underscores ( __ ). We have already seen such two methods __construct() and __destruct() … Read more

PHP Type Hinting with interface and abstract class

PHP Type Hinting with interface and abstract class

PHP Type Hinting In the last chapter, we have seen the PHP type hinting for arrays and objects. In this chapter, we will see how in some situations object type hinting would not work, and then, in that case, we can use abstract class or interface type hinting. The PHP Type hinting for the interface … Read more

Type hinting in PHP with example in detail

Type hinting in PHP

What is type hinting in PHP? As the name suggests, Type hinting in PHP is a hint about the data type of an argument in the function definition. Type hinting provides better data handling used in a program, as type hinting will strictly check the data send to the functions in a program. Currently, we are … Read more