酒店预订平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

3 年前
1234567891011121314151617181920212223242526272829303132333435363738
  1. VarExporter Component
  2. =====================
  3. The VarExporter component allows exporting any serializable PHP data structure to
  4. plain PHP code. While doing so, it preserves all the semantics associated with
  5. the serialization mechanism of PHP (`__wakeup`, `__sleep`, `Serializable`,
  6. `__serialize`, `__unserialize`).
  7. It also provides an instantiator that allows creating and populating objects
  8. without calling their constructor nor any other methods.
  9. The reason to use this component *vs* `serialize()` or
  10. [igbinary](https://github.com/igbinary/igbinary) is performance: thanks to
  11. OPcache, the resulting code is significantly faster and more memory efficient
  12. than using `unserialize()` or `igbinary_unserialize()`.
  13. Unlike `var_export()`, this works on any serializable PHP value.
  14. It also provides a few improvements over `var_export()`/`serialize()`:
  15. * the output is PSR-2 compatible;
  16. * the output can be re-indented without messing up with `\r` or `\n` in the data
  17. * missing classes throw a `ClassNotFoundException` instead of being unserialized to
  18. `PHP_Incomplete_Class` objects;
  19. * references involving `SplObjectStorage`, `ArrayObject` or `ArrayIterator`
  20. instances are preserved;
  21. * `Reflection*`, `IteratorIterator` and `RecursiveIteratorIterator` classes
  22. throw an exception when being serialized (their unserialized version is broken
  23. anyway, see https://bugs.php.net/76737).
  24. Resources
  25. ---------
  26. * [Documentation](https://symfony.com/doc/current/components/var_exporter.html)
  27. * [Contributing](https://symfony.com/doc/current/contributing/index.html)
  28. * [Report issues](https://github.com/symfony/symfony/issues) and
  29. [send Pull Requests](https://github.com/symfony/symfony/pulls)
  30. in the [main Symfony repository](https://github.com/symfony/symfony)