2079 11

BIT301 ยท 2079 ยท 5 marks

Describe an anonymous class using suitable example.

Describe an anonymous class using suitable example. [5]

Web Technology IIChapter 6: Object Oriented ProgrammingAnonymous classes

An anonymous class is a class written directly at the place where its single object is needed, with no name attached to it. PHP creates the class and the object in one expression, new class { ... }, a form available since PHP 7. Before that the only way to supply behaviour inline was a closure, w...