I searched this alot on net, but unable to find the answer that many people ask in the interview questions or in general question when they talk about PHP..
Which concepts of OOP are not available in PHP?
I have heard and read this many many time that PHP is not a completely OOP language, but when i google it, i am unable to find that which concepts of OOP are not available in PHP.
There is no built-in method for type casting of user defined objects in PHP (despite of having some workarounds).
<?php
class Book
{
public $title;
public $isbn;
}
class BookShelf
{
public static function create($booklist)
{
echo "Here are your books!";
}
}
$bookList = new Book;
BookShelf::create($bookList); // output "Here are your books!"
$bookList = new stdClass();
BookShelf::create((Book)$bookList); // output a parse error of undefined variable $bookList