Stub.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\VarDumper\Cloner;
  11. /**
  12. * Represents the main properties of a PHP variable.
  13. *
  14. * @author Nicolas Grekas <p@tchwork.com>
  15. */
  16. class Stub implements \Serializable
  17. {
  18. const TYPE_REF = 1;
  19. const TYPE_STRING = 2;
  20. const TYPE_ARRAY = 3;
  21. const TYPE_OBJECT = 4;
  22. const TYPE_RESOURCE = 5;
  23. const STRING_BINARY = 1;
  24. const STRING_UTF8 = 2;
  25. const ARRAY_ASSOC = 1;
  26. const ARRAY_INDEXED = 2;
  27. public $type = self::TYPE_REF;
  28. public $class = '';
  29. public $value;
  30. public $cut = 0;
  31. public $handle = 0;
  32. public $refCount = 0;
  33. public $position = 0;
  34. public $attr = array();
  35. /**
  36. * @internal
  37. */
  38. public function serialize()
  39. {
  40. return \serialize(array($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr));
  41. }
  42. /**
  43. * @internal
  44. */
  45. public function unserialize($serialized)
  46. {
  47. list($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr) = \unserialize($serialized);
  48. }
  49. }