Blog de programación, errores, soluciones

Chose Language:
comments
Author: Admin/Publisher |finished | checked

PHP – Interfaces and predefined Classes

In this section, we will simply define what these are without further explanation, as they are predefined classes and interfaces commonly used without us noticing. For example, Throwable is used with exceptions or Closure when creating an anonymous function. If you are interested in any of these classes or interfaces, you can dive deeper into them at PHP.net manual.

Generator: Generator objects are returned from generator functions.

Traversable: Interface for detecting if a class can be iterated over using foreach.

Iterator: Interface for external iterators or objects that can be iterated internally by themselves.

IteratorAggregate: For creating an external Iterator interface.

Throwable: Base interface for any object that can be thrown with a throw statement in PHP 7, including Error and Exception.

ArrayAccess: Interface to provide access to objects as arrays.

Serializable: Interface for customizing serialization.

Closure: Class used to represent anonymous functions.

Category: en-php
Something wrong? If you found an error or mistake in the content you can contact me on Twitter | @luisg2249_luis.
Last 4 post in same category

Comments