Last active
January 3, 2016 05:59
-
-
Save meadsteve/8419414 to your computer and use it in GitHub Desktop.
For when you need something. Anything in php.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class something implements \ArrayAccess, \Iterator | |
{ | |
protected $loopable = true; | |
public function offsetExists($offset) | |
{ | |
return true; | |
} | |
public function offsetGet($offset) | |
{ | |
return new self(); | |
} | |
public function offsetSet($offset, $value) | |
{ | |
} | |
public function offsetUnset($offset) | |
{ | |
} | |
function __get($name) | |
{ | |
return new self(); | |
} | |
function __set($name, $value) | |
{ | |
} | |
function __call($name, $arguments) | |
{ | |
return new self(); | |
} | |
public static function __callStatic($name, $arguments) | |
{ | |
return new self(); | |
} | |
function __invoke() | |
{ | |
return new self(); | |
} | |
function __toString() | |
{ | |
return "something"; | |
} | |
public function current() | |
{ | |
return new self(); | |
} | |
public function next() | |
{ | |
$this->loopable = false; | |
return new self(); | |
} | |
public function key() | |
{ | |
return "something"; | |
} | |
public function valid() | |
{ | |
return $this->loopable; | |
} | |
public function rewind() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment