My Blog

My WordPress Blog

My Blog

My WordPress Blog

05. Functions

Arrow Functions

Arrow functions were introduced in PHP 7.4 version. Arrow functions provide a simpler and more concise syntax for writing anonymous functions. With PHP 7.4, a keyword “fn” has been introduced for defining arrow functions, instead of the conventional use of the “function” keyword. Example The following example demonstrates how you can use the arrow function […]

Type Hints

PHP supports using “type hints” at the time of declaring variables in the function definition and properties or instance variables in a class. PHP is widely regarded as a weakly typed language. In PHP, you need not declare the type of a variable before assigning it any value. The PHP parser tries to cast the […]

Scroll to top