PHP interview questions


Total available count: 33
Subject - PHP Frameworks
Subsubject - PHP

What is the difference between named functions vs anonymous functions?

PHP has two types of functions. They are "named functions" and "anonymous functions". The below example explains with each function,

Example: 

<?php
    // A named function called "Slightbook".
    function Slightbook($x) {
       return 2 * $x;
    }
   $triple = function($x)
   {
     return 3 * $x;
   };
?>

 




Next 5 interview question(s)

1
What is the difference between self and $this?
2
What is the difference between var_dump() vs print_r()?
3
What is the use of ::class?
4
What is the use of var_dump() function?
5
What is Type Juggling and Type casting?


Comments