Skip to content

Instantly share code, notes, and snippets.

Last active Jan 29, 2016
What would you like to do?
namespace Acme;
class Immutable
protected $some = "some";
public function getSome()
return $this->some;
public function withSome($some)
$clone = clone $this;
$clone->some = $some;
return $clone;
public function __set($name, $value)
throw new \InvalidArgumentException();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment