title: Is there a simple PHP way to minimize the class name in serialization?
body: <p>I have a group of objects I need to serialize, but the class names are long, for example:</p>
  
  <pre><code>"\Namespace1\Subnamespace\dataobjectA"  
  "\Namespace1\Subnamespace\dataobjectB"  
  "\Namespace1\Subnamespace\dataobjectC"  
  "\Namespace1\Subnamespace\dataobjectD"
  </code></pre>
  
  <p>using the serialize function on the objects, I get:
  "O:41:\"Namespace1\Subnamespace\dataobjectC\":1:{s:4:"data";s:9:"some data";}"</p>
  
  <p>the serialization string contains the full class name which is sometimes bigger than the data :)</p>
  
  <ul>
  <li><p>I'm already familiar with <code>__sleep()</code> ans <code>__wakeup()</code> functions, not useful here.</p></li>
  <li><p>I understand that some king of lookup table required</p></li>
  </ul>
  
  <p>My question is:
  <strong>Is there a simple PHP way to minimize the class name in serialization</strong></p>
  
  <p>Any suggestion are welcome</p>