Skip to content

Instantly share code, notes, and snippets.

View marcelkohl's full-sized avatar

Marcel Kohls marcelkohl

  • Nord Security
  • Berlin, Germany
View GitHub Profile
@marcelkohl
marcelkohl / gist:509e4aeb38c80d5b8593d6c54c4280a3
Created May 18, 2020 14:33
php collection that handles countable, iterator array access and indexing with/without key
<?php
abstract class AbstractCollection implements Countable, Iterator, ArrayAccess
{
private $indexes = [];
private $values = [];
private $position = 0;
/**
* This constructor is there in order to be able to create a collection with