6. What OOP construct unavailable in PHP does the following script approximate?
<?php
class my_class
{
function my_funct ($my_param)
{
user_error ("Please define me", E_ERROR);
}
function b()
{
return 10;
}
}
?>
Вариант ответа 1 - A) Multiple inheritance
Вариант ответа 2 - B) Interfaces
Вариант ответа 3 - C) Abstract methods
Вариант ответа 4 - D) Private methods
Вариант ответа 5 - E) Function overloading
Комментарий: This tidbit of code approximates the behaviour usually provided by an abstract method. If this class is inherited by another class and the my_funct method is called without being overridden in the child class, the code will throw an error. Naturally, this is only an approximation of the way abstract methods work, but it’s the best that can be done using PHP limited object model.