Define anonymous classes in PHP7.

devquora
devquora

Posted On: Feb 22, 2018

 

In PHP7, Anonymous classes are those classes that don’t have any name. These anonymous classes are defined using the new class. It can replace full-class definition. When simple, one-off objects are created then anonymous classes are useful. They are internally generated names so we don’t have to give names to these classes. Objects created by same anonymous class are instances of that class.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    PHP 7 interview questions

    What new features PHP7 has in store for us?

    What new features PHP7 has in store for us?..