doctrine/instantiator — pull request #8 by davedevelopment (2014-10-04 21:13:58+00:00)
Title: Avoid cloning uncloneables

Fixes #7

I used XMLReader as I'm pretty sure that's everywhere theses days, and it doesn't have a __clone method.

The bug @whatthejeff mentioned (https://bugs.php.net/bug.php?id=53967) might bring further weirdness at some point, SplFileObject seems happy to be cloned if it's been instantiated using instantiator, but not if it's a "proper" instance?

```
PHP 5.6.0 (cli) (built: Oct 4 2014 20:41:37)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
```

``` php
instantiate('SplFileObject');

$b = clone $instance;

$a = new SplFileObject(__FILE__);
$b = clone $a;
```

```
PHP Fatal error: main(): An object of class SplFileObject cannot be cloned in /Users/davem/src/instantiator/test.php on line 11
PHP Stack trace:
PHP 1. {main}() /Users/davem/src/instantiator/test.php:0

shell returned 255
```