PHP Fatal PHP Fatal error: __clone method called on non-object
<p>So, I am working on a project and I am having an issue as I keep getting both errors and warnings. I am quite new to PHP so be gentle. The program runs fine using PHP 5.5 However when I run the program in PHP 5.6 I receive several errors as follows;</p>

<blockquote>
  <p>[10-Oct-2016 10:04:46 America/Denver] PHP Warning: Erroneous data format for unserializing 'MMR\Bundle\CodeTyperBundle\Entity\User' in /hermes/bosnaweb14a/b1234/.../application/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php on line 833
  [10-Oct-2016 10:04:46 America/Denver] PHP Notice: unserialize(): Error at offset 49 of 50 bytes in /hermes/bosnaweb14a/b1234/.../application/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php on line 833
  [10-Oct-2016 10:04:46 America/Denver] PHP Fatal error: __clone method called on non-object in /hermes/bosnaweb14a/b1234/.../application/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php on line 837</p>
</blockquote>

<p>Project Info</p>

<p>Platform: Symfony
PHP Version: 5.6</p>

<p>Affected Code</p>

<pre><code>public function newInstance()
{
    if ($this-&gt;_prototype === null) {
        if (PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513) {
            $this-&gt;_prototype = $this-&gt;reflClass-&gt;newInstanceWithoutConstructor();
        } else {
           $this-&gt;_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this-&gt;name), $this-&gt;name)); //Line 833
        }
    }

  return clone $this-&gt;_prototype; //Line 837
}
</code></pre>

<p>Any help would be greatly appreciated</p>